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:
-
Backup your database
mysqldump -u root -p icehrm > icehrm_backup_$(date +%Y%m%d).sql -
Backup your files
cp -r /var/www/icehrm /var/www/icehrm_backup_$(date +%Y%m%d) -
Note your current version - Found in System > Settings > System: Version
Using icehrm-updater (Recommended)
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:
- Detect your current version
- Download the latest release
- Backup your current installation
- Apply updates
- Run database migrations
- 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
- Log in to IceHrm
- Navigate to System > Settings
- Verify the version number has been updated
- Test critical functionality
IceHrm Pro 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:
- Check extension compatibility - Verify your extensions are compatible with the new version
- Backup extensions - Save your extension files separately
cp -r /var/www/icehrm/extensions /tmp/extensions_backup - Contact support - If you have custom extensions, contact IceHrm support for upgrade guidance
Pro Update Process
- Download the Pro update from your IceHrm account
- Follow the same manual update process above
- Re-apply any custom extensions after the core update
- 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:
- Check the IceHrm documentation
- Search the GitHub issues
- Contact IceHrm support (Pro users)