Upgrade from 2.4.8.5 to 3.x - Intermediate upgrade?

Somewhere on the OJS forum there was a topic on upgrading from 2.4.8.5 to 3.x. BUT the topic stated that you MUST go to an intermediate version of 3.x versus upgrading to the newest release.

Unfortunately I cannot find that topic/thread ANYWHERE on this forum. Can someone show me please? Many thanks! I did find the bookmarking function on this forum so it will be book marked for ever!

Hi @radjr,

There’s a document included in the OJS package in docs/UPGRADE-UNSUPPORTED.md that makes recommendations – you can read it online for the latest 3.3.x release here:

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alec! I had seen it before but I could not find it again! Sheesh! Guess I need a beer!

Hi @radjr,

Not that the beer’s a bad idea – but no problem, it’s helpful to have documents like that linked from here in the forum in case people search for it.

Regards,
Alec Smecher
Public Knowledge Project Team

Alec, I followed these instructions as well as your Youtube video and when I run the command php tools/upgrade.php check there is no output to the screen. Unlike the video that shows the codebase and database versions. Here is the error messages.

[13-Apr-2022 20:39:30 America/New_York] PHP Warning: Constants may only evaluate to scalar values in /home/radjr1/domains/ojs2.wmpllc.org/public_html/ojs/lib/pkp/classes/db/DBConnection.inc.php on line 17
[13-Apr-2022 20:39:30 America/New_York] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /home/radjr1/domains/ojs2.wmpllc.org/public_html/ojs/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

Dumb question. Do we need to run running PHP7.x for this to upgrade to run? If so how to you make 7.x run in place of 5.4 when both are installed?
Lastly, the system panel is showing.
php

Installed 5.6.40
php2
Installed 7.2.34
php3
Installed 7.4.28
php4

Installed 7.3.33

Thanks!

Hi @radjr,

I’m guessing you’re trying to upgrade to the latest 3.2.x, correct? If so, you’ll need to be using PHP between 7.2.x and 7.4.x. I expect 5.6.0 is the one that’s running when you execute php without specifying a path; that’s too old, hence the error message.

If you’re using the command-line upgrade tool (recommend), you’ll need to specify a path to the right version of PHP – that is, /path/to/php tools/upgrade.php instead of php tools/upgrade.php, where /path/to is the path to the appropriate version of PHP. Unfortunately I’m not sure what that path will be on your server; you may need to check your service provider’s knowledge base.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alec. Suggest a note be made in the upgrade package because if people are sandboxing their upgrade from a clone, they may hit the same issue… Then again, we are probably the last people on the planet to upgrade so the horse has left the barn!

Alec, We have had problems doing a jump from 2.4.8.5 to 3.2. Is there a better intermediate version of OJS that we should use instead of 3.2? Thanks, radjr

Also when you do a backup of the OJS folder, does the SQL database get copied too?

Hi @radjr,

Is there a better intermediate version of OJS that we should use instead of 3.2?

Probably not, but it depends – what problems did you run into?

Also when you do a backup of the OJS folder, does the SQL database get copied too?

No; MySQL stores its contents elsewhere on the server, and backups/restores are done using the MySQL toolset. See the following:

https://docs.pkp.sfu.ca/faq/en/site-administration#how-can-i-create-a-backup-of-my-site

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alec. We will try again. It is possible that the upgrade was run under the root user and not the user that runs ojs. We did seem to miss one step which was to copy the public directory…and copying after the upgrade did not fix the problem.

As for backups, I have used the backup in the OJS system folder ojs/index.php/index/backup but that creates and downloads the .sql file. If we run in to upgrade problems and have to restore the database, we can only use the VPS full backup to get the system back to some known state. It is unclear how to restore that SQL file and really made us rethink our backup strategy.
Thanks!

Hi @radjr,

If you can capture the upgrade problem in detail, I can potentially make suggestions.

The OJS backup plugin uses mysqldump to extract the contents of the database into the .sql file. As long as the .sql is extracted completely (i.e. your server doesn’t hit some kind of timeout while it’s happening) the .sql file should contain a complete record of the database schema and data. Restoring it is more of a MySQL question than an OJS question, but you can usually use a CPanel-based tool like PHPMyAdmin to reload the database from a database dump file like this.

Regards,
Alec Smecher
Public Knowledge Project Team

Well.seems the second try is the charm… Atleast PHP 7.4 is running. Still need to make sure everything else is where it should be.

image

I ran the check php tools/upgrade.php check and got the following messages.

[19-Apr-2022 18:13:53 America/New_York] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /home/radjr1/domains/ojs2.wmpllc.org/public_html/ojs/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

Well, it seems that the version three code is reporting PHP 7.4.28 BUT if I run php -v, it replies with version 5.6!! NOW I am confused.

Recommended system requirements

NOTE: If I path to PHP74, the upgrade.php check program reports what you would expect.
SO…should I run the upgrade pathed to PHP74?

Thank you.

Hi @radjr,

This is what I was suspecting in my post above. Just running php may give you a version that’s different from what CPanel reports – and in your case, a very old version. You may need to specify the path to the right PHP executable when you run your command line upgrade.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks. So this upgrade should run properly if pathed directly to php74?

Also, I presume the site will run properly as the setup page seems to find 7.4 by itself…correct?

Again thanks Alec!

For future references, you can find upgrade documentation at PKP’s doc hub:

https://docs.pkp.sfu.ca/admin-guide/en/

Cheers,
m.

Yes, thanks. That is a good page. In our case we decided to clone the VPS that was running OJS and do the test upgrade on that server. That in itself introduced some interesting challenges one of which is file ownership. This gets compounded with control panels like Cpanel, Direct admin or plesk as they add a level of indirection based on the users installed in those control panels. Anyway, we did get it running with the correct permissions and everyone should get comfortable with Chown. In our case, I logged in as root and forgot that OJS was running under a different user that was created by DirectAdmin. Anyways, words for the wise. That said, my sincere thanks to everyone especially Alec!

2 Likes

Well the fun continues… Got this error message when trying to tweak journal settings.

An unexpected error occurred. You may have been logged out. Please reload the page and try again.

Hi @radjr,

If you received confirmation that the upgrade succeeded (e.g. “Successfully upgraded to version 3.3.0-10”) then it’s likely that you’re encountering something new that’s not related to the upgrade, but likelier some interaction of your platform and the new version.

If that’s the case, I’d suggest starting fresh in asking what’s happening – check your PHP error log and summarize what you find in a new thread if you don’t see it elsewhere on the forum. That’ll help keep this thread from growing beyond its original topic.

If you didn’t get a confirmation that the upgrade succeeded, then it’s likely that the upgrade didn’t complete 100% – you should get an error in the PHP error log if nothing else.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alec. We did receive confirmation on screen that the upgrade completed successfully. I think it said Successfully upgraded to 3.2.1.10. There is no error in the PHP error log. Interesting, things like the quick submit plugin and all the graphical elements from 2.4.8.5 are gone. When looking at the Plug-in gallery, it just sits and spins and never returns anything. I used the config.inc.php from the 2.4.8.5 install and made no other changes. Is there an additional directive that is required for 3.2? Cheers and thanks!