Commandline upgrade of plugins?

Is there a way to upgrade plugins from the command line?

We have a situation where the order of upgrading the base OJS and OJS plugins appears to be important.

From a testing point of view, it would be very useful if the OJS upgrade script had a mode that upgraded all the plugins to their latest versions.

The GUI for upgrading plugins does not lend itself to batch processing at all.

Additionally, if there is ever a security issue discovered in a plugin, having a commandline approach is likely to ensure that the fix is more readily propagated.

Steps I took leading up to the issue
For example:

  1. Tried to batch-upgrade plugins from the commandline, but couldn’t work out how to do it.
  2. Tried to batch-upgrade plugins using the web-based GUI. It took four clicks and scroll, with pauses between them, per plugin.

What application are you using?
OJS / Linux

Hi @stuart.yeates,

Thanks for your post. There is kind of a way to install plugins via CLI, it does involve interacting with the database though. One of my colleague outlines it in this post.:

Hi everyone,

There already is a way to install a plugin via the command line, with the installPluginVersion.php CLI tool that comes with OJS. It can be used like:

php lib/pkp/tools/installPluginVersion.php path/to/plugin/version.xml

To actually continue with enabling the plugin, you’d need to set the enabled plugin setting in the plugin_settings table to 1 for the journal_id in question. Some plugin categories have a setEnabled method that you can use for this, but most notably the Generic plugin does not. You may need to wrap the plugin installer with a bit of code that fetches your journal ids in the installation and then updates this value. You could probably do this with a series of MySQL REPLACE statements, which would create the record if it did not already exist or update it if it did.


Even still, there is an inherent risk to updating all plugins at once.

With respect to your point about:

From a testing point of view, it would be very useful if the OJS upgrade script had a mode that upgraded all the plugins to their latest versions.

As it stands, this would be fairly tricky because many plugins (a number of which are third-party developed and not developed by PKP) are not always deemed compatible with a given release of OJS. For example, in the coming weeks we will likely be releasing version 3.4. We will have tested a number of plugins against 3.4 as part of this, but there will be a number that will not yet be compatible (it would be up for those responsible for their development to test them and ensure their compatibility). So to upgrade all plugins at once would mean a lot of plugins that wouldn’t be compatible with a given release and this could spell problems for running one’s OJS install. One of the advantages, while slow, that upgrading via the GUI provides (and which is why we strongly encourage installing and upgrading via this method) is that it ensures the checking of compatibility of the plugins prior to installing/upgrading. This is explored in our Plugin Inventory guide: (and the compatibility checker included in here can be useful as well)

Your suggestion around a CLI utility is a good point and maybe things like incompatibility checks could be taken into account for something like this. What you might want to do is start a new “Feature Request” in that category here on the forum and our developers would discuss that with you there.

PKP Team


Hi @stuart.yeates,

I think this issue is relevant:

There is a command-line tool to list plugins in the Plugin Gallery along with their installed state (see lib/pkp/tools/plugins.php; this could be extended to allow for command-line installation of plugins without a lot of work, if you’re interested in tinkering.

Alec Smecher
Public Knowledge Project Team


Even still, there is an inherent risk to updating all plugins at once.

Upppss… what is this risk?
I’m doing it all the time. :see_no_evil:

(after a backup, of course… but I never though it could break our installations)

Hi @marc,

I think what I meant by that is that if you update all plugins at once and they’re not compatible with the version of OJS you’re running, that could lead to issues.

And great point about having the backups :wink:


1 Like

I almost had a heart attack. :joy: :joy: :joy:

Okay. If so, that’s something I’m counting on.

Thank you Roger for your tireless work on the forum.