Skip to main content
Open Source Only

This documentation is applicable only for IceHrm Open Source.

Upgrading IceHrm

This guide covers how to upgrade your IceHrm installation to the latest version.

Before You Begin

Before upgrading, always:

  1. Backup your database

    mysqldump -u root -p icehrm > icehrm_backup_$(date +%Y%m%d).sql
  2. Backup your files

    cp -r /var/www/icehrm /var/www/icehrm_backup_$(date +%Y%m%d)
  3. Note your current version - Found in System > Settings > System: Version

The icehrm-updater is an npm tool that automates the upgrade process.

Install the Updater

# Install Node.js if not present
sudo apt install -y nodejs npm

# Install icehrm-updater globally
sudo npm install -g icehrm-updater

Run the Updater

# Navigate to your IceHrm directory
cd /var/www/icehrm

# Run the updater
icehrm-updater

The updater will:

  1. Detect your current version
  2. Download the latest release
  3. Backup your current installation
  4. Apply updates
  5. Run database migrations
  6. Clear caches

Updater Options

# Check for available updates without installing
icehrm-updater --check

# Update to a specific version
icehrm-updater --version 32.0.0

# Skip backup (not recommended)
icehrm-updater --skip-backup

# Verbose output
icehrm-updater --verbose

Manual Update Process

If you prefer to update manually or the updater is not available, follow these steps:

Step 1: Download the Latest Version

cd /tmp
wget https://github.com/gamonoid/icehrm/releases/latest/download/icehrm.zip
unzip icehrm.zip

Step 2: Put Application in Maintenance Mode

Create a maintenance file to prevent user access during the update:

touch /var/www/icehrm/data/maintenance

Step 3: Backup Configuration

Preserve your configuration file:

cp /var/www/icehrm/app/config.php /tmp/config.php.backup

Step 4: Update Application Files

# Remove old files (except data and config)
cd /var/www/icehrm
sudo rm -rf app/classes app/lib web vendor

# Copy new files
sudo cp -r /tmp/icehrm-*/app /var/www/icehrm/
sudo cp -r /tmp/icehrm-*/web /var/www/icehrm/
sudo cp -r /tmp/icehrm-*/vendor /var/www/icehrm/

Step 5: Restore Configuration

cp /tmp/config.php.backup /var/www/icehrm/app/config.php

Step 6: Run Database Migrations

Access the migration endpoint in your browser:

https://your-domain.com/app/migrate.php

Or run via command line:

cd /var/www/icehrm
php app/migrate.php

Step 7: Clear Caches

# Clear application cache
rm -rf /var/www/icehrm/data/cache/*

# Clear compiled templates
rm -rf /var/www/icehrm/data/templates_c/*

Step 8: Set Permissions

sudo chown -R www-data:www-data /var/www/icehrm
sudo chmod -R 755 /var/www/icehrm
sudo chmod -R 777 /var/www/icehrm/data

Step 9: Remove Maintenance Mode

rm /var/www/icehrm/data/maintenance

Step 10: Verify the Update

  1. Log in to IceHrm
  2. Navigate to System > Settings
  3. Verify the version number has been updated
  4. Test critical functionality

IceHrm Pro Users

Important Note for IceHrmPro Users

If you are using IceHrm Pro, you may have additional extensions or modules installed. These require special attention during upgrades.

Extension Compatibility

Before upgrading IceHrm Pro:

  1. Check extension compatibility - Verify your extensions are compatible with the new version
  2. Backup extensions - Save your extension files separately
    cp -r /var/www/icehrm/extensions /tmp/extensions_backup
  3. Contact support - If you have custom extensions, contact IceHrm support for upgrade guidance

Pro Update Process

  1. Download the Pro update from your IceHrm account
  2. Follow the same manual update process above
  3. Re-apply any custom extensions after the core update
  4. Test extension functionality

Extension Updates

After upgrading the core application:

# Restore extensions
cp -r /tmp/extensions_backup/* /var/www/icehrm/extensions/

# Clear extension cache
rm -rf /var/www/icehrm/data/cache/extensions/*

Check for extension updates in your IceHrm Pro account, as extensions may need to be updated separately to maintain compatibility.

Troubleshooting

Common Issues

White screen after update:

  • Check PHP error logs: tail -f /var/log/nginx/icehrm_error.log
  • Verify file permissions
  • Clear all caches

Database migration errors:

  • Restore database backup
  • Check MySQL user permissions
  • Review migration logs

Missing features after update:

  • Clear browser cache
  • Re-run database migrations
  • Check extension compatibility

Getting Help

If you encounter issues:

  1. Check the IceHrm documentation
  2. Search the GitHub issues
  3. Contact IceHrm support (Pro users)