Upgrading OJS
Always back up first
Before upgrading, take a full backup of your database and files directory. Upgrades cannot be automatically reversed.
Pre-Upgrade Checklistโ
- Backup database:
mysqldump -u ojsuser -p ojs > ojs_backup_YYYYMMDD.sql - Backup files directory:
tar -czf ojs-files-backup.tar.gz /var/www/ojs-files - Backup
config.inc.php:cp config.inc.php config.inc.php.bak - Check the release notes for breaking changes
- Test the upgrade on a staging server first
- Disable any custom plugins and note their versions
Upgrade Stepsโ
1. Download the New Releaseโ
wget https://pkp.sfu.ca/software/ojs/download/ojs-3.5.x.tar.gz
tar -xzf ojs-3.5.x.tar.gz
2. Replace Application Filesโ
# Preserve your config and data
cp /var/www/html/ojs/config.inc.php /tmp/config.inc.php.bak
# Replace application files (do NOT delete the public/ or cache/ subdirectories of your files_dir)
rsync -av --exclude='config.inc.php' \
--exclude='public/' \
ojs-3.5.x/ /var/www/html/ojs/
3. Restore Configโ
cp /tmp/config.inc.php.bak /var/www/html/ojs/config.inc.php
4. Run the Upgrade Scriptโ
cd /var/www/html/ojs
php tools/upgrade.php upgrade
Review the output for any errors before proceeding.
5. Clear Cachesโ
php lib/pkp/tools/cacheClear.php
Or via the admin panel: Administration โ Clear Caches
6. Re-enable Pluginsโ
Re-enable and update any plugins that were disabled before the upgrade.
Troubleshootingโ
| Issue | Solution |
|---|---|
| Blank page after upgrade | Check PHP error log; run php tools/upgrade.php upgrade again |
| Missing tables | Confirm the upgrade script completed without errors |
| Plugin errors | Disable the plugin; check for a compatible version |
| File permission errors | chown -R www-data:www-data /var/www/html/ojs |
Further Readingโ
- PKP Upgrading Guide โ Steps for upgrading OJS
- OJS Release Notes โ Changelog for every OJS version
- PKP Forum โ Upgrades โ Community upgrade Q&A