OJS Upgrade

June 9th, 2011

For sometime now, the latest stable version of Open Journal System is 2.3.5. The current OJS installation is 2.1.x, and we should upgrade to the newest release to take advantage of the new features it has, and also because it includes security improvements (outdated software is always a potential risk in a server, as attackers can take advantage of security holes in versions that are not longer supported, although the stable version 2.1 is still secure enough, according to the OJS website). I’ve been testing the newer version at the New Media Lab, and with André we did an upgrade in the past. The instructions for the upgrade are in the docs/UPGRADE file that can be found in the OJS source, that can be obtained here:


Upgrading from source (the third option listed) has been for me the easiest way. Here are the instructions from the UPGRADE file:

3. Full Package

It is also possible to upgrade by downloading the complete package for the latest release of OJS:

– Download and decompress the package from the OJS web site

– Make a copy of the config.inc.php provided in the new package

– Move or copy the following files and directories from your current OJS installation:

– config.inc.php

– public/

– Your uploaded files directory (“files_dir” in config.inc.php), if it resides within your OJS directory

– Replace the current OJS directory with the new OJS directory, moving the old one to a safe location as a backup

– Be sure to review the Configuration Changes section of the release notes in docs/release-notes/README-(version) for all versions between your original version and the new version. You may need to manually add new items to your config.inc.php file.

In our installation, the folder public/ must be copied from the old installation into the new one, and the “files_dir” must be linked as is currently in the config.inc.php file. This folder should be located outside the ojs installation, or otherwise protected from http access by creating a .htaccess config file, with a “deny all” rule. In the first case (recommended) it shouldn’t be necessary to copy it into the new version, provided that the config.inc.php file has the path to it.

Important: the config.inc.php file cannot be copied as is, because the new version includes options that are not contemplated in the old one. I used a program called kompare (a graphical front-end of the diff program, for KDE) to see the differences.

File Permissions

This can be a little tricky. In the OJS forum, there is some advise about how to set them. It can be found here:


However, in our installation we have taken a different approach. Basically, the ownership of the installation is given to the unix user, while it belongs to the apache group. The command should look like this:

$ chown <user>:apache -R /path/to/the/ojs/directory

This is because the config.inc.php and the public and files_dir folders must be writable by the apache user. In the OJS forum, the recommendation is to make these files and folders universally writable. How potentially risky this can be has been discussed here:


The permissions are not set out of the box, the system administrator must apply them manually. This step has given me a few headaches in the past.

DB upgrade

Once these steps are completed, the DB upgrade is straightforward. The easiest way to do it is by using the CLI tool provide by OJS, as explained in the UPGRADE file:

1. Command-line

If you have the CLI version of PHP installed (e.g., /usr/bin/php), you can upgrade the database by running the following command from the OJS directory:

$ php tools/upgrade.php upgrade

Layout changes

As I have seen when testing the newest version at the New Media Lab, it has some minor changes in the layout, which will affect the look and feel of your journal. If you have a customized appearance (as LLJournal does, it can be seen at http://lljournal.gc.cuny.edu) you will have to edit the CSS in order to adapt it to the new version.

Leave a Reply