Open Journal Systems (OJS) : Upgrade version

1. Check Current Version and Requirements
  • Log in to OJS admin panel →  page to confirm your current version.
  • Visit [PKP OJS release notes](https://pkp.sfu.ca/ojs/ojs_download/) to check:
    • Minimum PHP version required
    • Database compatibility

2. Backup Everything (Critical!)

  • Run the following commands: 
    #cd /var/www/html/ojs
  • Backup files 
    #tar -czvf ~/ojs_files_backup_$(date +%F).tar.gz .
  • Backup database 
    #mysqldump -u db_user -p db_name > ~/ojs_db_backup_$(date +%F).sql

*Note:Replace `db_user` and `db_name` with your actual credentials from `config.inc.php`.

3. Put OJS in Maintenance Mode

  • Add a temporary maintenance `index.html` or use your web server’s maintenance configuration.Or, 
  • in `config.inc.php`:

  ```ini
  installed = On
  maintenance_mode = On
  ```

4. Download the Latest OJS Release

#cd /tmp
#wget https://pkp.sfu.ca/ojs/download/ojs-x.x.x.tar.gz
#tar -xzvf ojs-x.x.x.tar.gz

5. Replace Application Files

#cd /var/www/html/ojs
#mv config.inc.php ~/config.inc.php.bak
#mv public ~/public_bak
#rm -rf *   # remove old files (except backups)
  • Copy new OJS files
#cp -r /tmp/ojs-x.x.x/* .
#cp ~/config.inc.php.bak config.inc.php
#cp -r ~/public_bak public

6. Set Correct Permissions 

  • Adjust permissions for files_dir (from config.inc.php) and cache directories: 

#chown -R www-data:www-data /var/www/html/ojs
#chmod -R 755 /var/www/html/ojs
#chmod -R 775 /path/to/files_dir

7. Run the Upgrade Script 

#php tools/upgrade.php check
#php tools/upgrade.php upgrade 

8. Clear Cache

#rm -rf cache/* 

9. Disable Maintenance Mode 

10. Test the Site 

11. Remove Old Backups (Optional) 

#rm ~/ojs_files_backup_*.tar.gz
#rm ~/ojs_db_backup_*.sql 

Post a Comment

Previous Post Next Post