Skip to main content

OJS Migration Guide: Moving from OJS 2.x to OJS 3.3

Role: Site Administrator
Time: 2โ€“4 hours (depending on database size and number of journals)
Source: OJS 2.4.x (any 2.4 release)
Target: OJS 3.3.0-19 (latest 3.3 series release)

Major version migration

This is a major version migration. The OJS 2.x and OJS 3.x series have fundamentally different database schemas, file structures, and plugin APIs. There is no automatic rollback โ€” a full pre-migration backup is mandatory.

What Changes in OJS 3โ€‹

AreaOJS 2.xOJS 3.x
User interfaceSmarty-based server-renderedReact-based single-page
Plugin APILegacy hooks systemPKP-lib hooks + REST API
File storageFlat-file, submissions/journal_idContextual directory tree
DatabaseMySQL 5.5+MySQL 8.0+ / PostgreSQL 14+
PHP5.6 (end of life)8.1+
Theme systemIndividual journal themesBootstrap-based parent/child
Workflow3-stage (submission, review, editing)4-stage (submission, review, copyediting, production)
DOI pluginOptional, separate installBundled from 3.4+

Pre-Migration Checklistโ€‹

  • Full database backup: mysqldump -u ojsuser -p ojs2 > ojs2_backup_$(date +%Y%m%d).sql
  • Full files directory backup: tar -czf ojs2-files-$(date +%Y%m%d).tar.gz /var/www/ojs-files
  • Full application backup: tar -czf ojs2-app-$(date +%Y%m%d).tar.gz /var/www/html/ojs
  • Verify PHP version on target server is 8.1 or higher
  • Verify MySQL is 8.0+ or PostgreSQL is 14+
  • Note all currently active plugins and their versions
  • List any custom themes or templates
  • Document all custom locale overrides
  • Notify authors, reviewers, and editors of planned downtime
  • Test migration on a staging server first

Migration Stepsโ€‹

Step 1 โ€” Upgrade to the Latest OJS 2.4.x Firstโ€‹

Before migrating to OJS 3, ensure you are on the latest OJS 2.4.x release (2.4.8-5 as of 2024). Migration from an older 2.4 release may fail.

# Check your current OJS 2.x version
cat /var/www/html/ojs/dbscripts/xml/version.xml | grep -i release

Step 2 โ€” Install OJS 3.3 on a Separate Directoryโ€‹

Do not overwrite your OJS 2 installation. Install OJS 3.3 alongside it.

cd /var/www/html
wget https://pkp.sfu.ca/software/ojs/download/ojs-3.3.0-19.tar.gz
tar -xzf ojs-3.3.0-19.tar.gz
mv ojs-3.3.0-19 ojs3

Step 3 โ€” Create a New Database for OJS 3โ€‹

CREATE DATABASE ojs3 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON ojs3.* TO 'ojsuser'@'localhost';
FLUSH PRIVILEGES;

Step 4 โ€” Configure OJS 3โ€‹

cp /var/www/html/ojs3/config.TEMPLATE.inc.php /var/www/html/ojs3/config.inc.php

Edit config.inc.php:

[database]
driver = mysqli
host = localhost
username = ojsuser
password = yourpassword
name = ojs3

[files]
files_dir = /var/www/ojs3-files

Create the files directory:

mkdir -p /var/www/ojs3-files
chown -R www-data:www-data /var/www/ojs3-files /var/www/html/ojs3

Step 5 โ€” Run the OJS 3 Installer (Fresh Install)โ€‹

Navigate to https://yoursite.com/ojs3/ in your browser and complete the web installer. This creates an empty OJS 3 database.

important

Use the same administrator email as your OJS 2 installation to avoid user duplication issues.

Step 6 โ€” Import OJS 2 Data into OJS 3โ€‹

OJS 3 ships with a migration script that reads your OJS 2 database directly:

cd /var/www/html/ojs3
php tools/importExport.php OJS2MigrationPlugin \
--sourceDBHost=localhost \
--sourceDBUsername=ojsuser \
--sourceDBPassword=yourpassword \
--sourceDBName=ojs2 \
--sourceFilesDir=/var/www/ojs-files
Long-running process

For large installations (thousands of submissions), this migration script can take 1โ€“3 hours. Run it inside a screen or tmux session to prevent SSH disconnection from interrupting the process.

screen -S ojs-migration
# then run the migration command
# detach with Ctrl+A, D

Step 7 โ€” Migrate Uploaded Filesโ€‹

# Copy OJS 2 public files to OJS 3 public directory
cp -r /var/www/html/ojs/public/. /var/www/html/ojs3/public/

# Files directory is already specified in config.inc.php
# Verify the migration script copied files correctly
ls /var/www/ojs3-files/

Step 8 โ€” Run the Upgrade Scriptโ€‹

After the import, run the upgrade to apply any post-import schema migrations:

cd /var/www/html/ojs3
php tools/upgrade.php upgrade

Step 9 โ€” Clear Cachesโ€‹

php lib/pkp/tools/cacheClear.php

Or via Administration โ†’ Clear Caches in the web interface.

Step 10 โ€” Verify and Switch DNS/Webserverโ€‹

  1. Check that all journals, submissions, and users appear correctly
  2. Verify galley files are accessible
  3. Check article DOIs still resolve correctly
  4. Update your webserver configuration to serve OJS 3 at the main domain
  5. Keep OJS 2 available at a temporary URL for comparison during the verification period

Post-Migration Verification Checklistโ€‹

  • All journals appear under Hosted Journals
  • User accounts and roles are intact
  • Submissions appear in correct stages
  • Published articles are accessible with their original URLs
  • Galley files (PDF, HTML) download correctly
  • DOIs resolve to the correct article pages
  • Email sending works (test from Settings โ†’ Website โ†’ Emails)
  • Reviewer and author notifications function correctly

Common Issuesโ€‹

IssueCauseSolution
Migration script exits with "DB Error"Character encoding mismatchEnsure both databases use utf8mb4
Missing galley files after migrationWrong files_dir path in configVerify the path in config.inc.php and re-run migration
Blank pages after switchPHP version too oldConfirm server runs PHP 8.1+
Plugin errors on dashboardOJS 2 plugins are incompatibleDisable all plugins; install OJS 3 equivalents
"Table doesn't exist" errorsUpgrade script not completedRe-run php tools/upgrade.php upgrade
Custom theme brokenOJS 2 themes are not compatibleSwitch to Default or Health Sciences theme; rebuild custom theme
URLs changed for articlesNew URL pattern in OJS 3Enable URL redirects from OJS 2 paths using your web server

Plugin Compatibility After OJS 2 โ†’ OJS 3 Migrationโ€‹

All OJS 2 plugins are incompatible with OJS 3. After migration you must:

  1. Disable all plugins under Website โ†’ Plugins
  2. Find OJS 3-compatible equivalents from PKP Plugin Gallery
  3. Install and configure each replacement plugin individually

See the Plugin Upgrade Guide for a full compatibility matrix.

Rollback Procedureโ€‹

If the migration fails or produces incorrect results:

# Stop serving OJS 3
# Restore the OJS 2 webserver configuration

# Drop the partial OJS 3 database
mysql -u root -p -e "DROP DATABASE ojs3; CREATE DATABASE ojs3 CHARACTER SET utf8mb4;"

# Remove the OJS 3 files directory
rm -rf /var/www/ojs3-files/*

# Restart from Step 4

Your OJS 2 installation and its database were never touched โ€” restore the web server config to point to OJS 2 and you are back online immediately.

Next Stepsโ€‹

After a successful migration to OJS 3.3, continue upgrading:

โžก๏ธ OJS 3.3.x.x โ†’ OJS 3.4.y.y Migration Guide

Further Readingโ€‹