Skip to main content

Site Administration

Guidance for site administrators managing the OJS server environment — backups, migrations, version checks, and URL configuration.

How do I back up an OJS installation?

A complete OJS backup has three components — all three are required for a full recovery:

1. Database

Use your database tool to dump the entire OJS database:

# MySQL / MariaDB
mysqldump -u [db_user] -p [db_name] > ojs_backup_$(date +%Y%m%d).sql

# PostgreSQL
pg_dump -U [db_user] [db_name] > ojs_backup_$(date +%Y%m%d).sql

2. OJS application directory

Back up the entire OJS installation directory, which includes your config.inc.php, plugins, themes, and the public/ directory (for publicly accessible uploaded files).

tar -czf ojs_files_$(date +%Y%m%d).tar.gz /var/www/ojs/

3. Private files directory (files_dir)

The files_dir setting in config.inc.php points to your private uploads directory (which should be outside the web root). This contains all submitted manuscripts, galleys, and other non-public files. Back it up separately if it is not inside your OJS application directory.

Automate with cron:

# Example cron entry: daily backup at 2 AM
0 2 * * * /path/to/backup_script.sh
tip

The Backup Plugin (available in the Plugin Gallery) can automate backups from within the OJS administration interface and is a practical option for installations without cron access.

warning

Store backups in a location separate from the server itself — an offsite object store, a different server, or an external drive. A backup on the same machine is worthless if the server fails catastrophically.

How do I move OJS to a different server?

A server migration involves moving three things to match the backup components above:

Step 1 — Export the database from the old server:

mysqldump -u [db_user] -p [db_name] > ojs_migration.sql

Step 2 — Import the database on the new server:

mysql -u [new_db_user] -p [new_db_name] < ojs_migration.sql

Step 3 — Copy the application directory and files:

# On old server
rsync -avz /var/www/ojs/ user@new-server:/var/www/ojs/

# Also copy files_dir if it is in a separate location
rsync -avz /var/ojs-files/ user@new-server:/var/ojs-files/

Step 4 — Update config.inc.php on the new server:

Several settings typically need updating for a new server:

; Update base URL
base_url[index] = "https://journals.newdomain.com"

; Update database credentials
host = localhost
username = new_db_user
password = new_db_password
name = new_db_name

; Update files directory path if it changed
files_dir = /var/ojs-files

; Update email settings if the mail server changed
smtp_server = mail.newdomain.com

After updating config, clear all OJS caches from Administration → Clear Caches and verify the site loads correctly before decommissioning the old server.

info

If your journal URL is changing (not just the server), you will also need to update any registered DOIs and notify indexing services (Google Scholar, DOAJ, etc.) of the new URL.

How do I check which version of OJS I'm running?

There are three ways to check:

1. Via the OJS interface (easiest): Log in as Site Administrator → AdministrationSystem Information. The current OJS version is displayed at the top of the page.

2. Via command line:

php tools/upgrade.php check

This also reports whether an upgrade is available.

3. Via SQL query:

SELECT major, minor, revision, build
FROM versions
WHERE current = 1
AND product_type = 'core';
tip

When asking for help on the PKP Community Forum, always include your full version number (e.g. 3.4.0-7) — bug fixes and features differ significantly between minor releases and build numbers.

How do I remove "index.php" from OJS URLs?

By default, OJS URLs include index.php (e.g. https://example.com/index.php/journal/article/view/123). You can remove it by enabling restful URLs:

Step 1 — Enable in config.inc.php:

restful_urls = On

Step 2 — Enable Apache mod_rewrite and configure .htaccess:

Ensure mod_rewrite is enabled on your server. Then confirm that your OJS .htaccess file (already included in the OJS distribution) is active. It should contain rules similar to:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

For this to work, your Apache virtual host or directory config must allow .htaccess overrides:

<Directory /var/www/ojs>
AllowOverride All
</Directory>

For Nginx: Instead of .htaccess, add the equivalent rewrite rule directly to your Nginx server block:

location / {
try_files $uri $uri/ /index.php$is_args$args;
}
warning

After enabling restful URLs, clear all OJS caches. Any hardcoded links to the old index.php URLs (in navigation menus, announcements, or external sites) will need to be updated — though OJS will continue to accept the old format as well.

Further Reading