[OJS2.4.8 to 3.1.2-3] XAMPP, How to Upgrade with upgrade.php

@asmecher

I’m running XAMPP for MacOS X v7.3.11 and try to make a local OJS test upgrade from 2.4.8 to 3.1.2-3 before upgrading the main OJS system online.

But I got stuck: Trying to upgrade via install page results in timeout (blank page). Reloading leads to DB Error: Table 'db35967.articles' doesn't exist.

But how can I upgrade with the cli tool? I tried to do this via terminal with php /tools/upgrade.php upgrade, but nothing happens (yes, php is in PATH).

Can someone give me a clue?

Thanks, Tobias

Hi @twa,

Each time you try to upgrade and something goes wrong, you’ll have to restore from backup. That explains the articles doesn't exist error message.

For the CLI tool, you’ll need to change directory into your OJS installation directory, then run

php tools/upgrade.php`

I think the leading slash in /tools/upgrade.php caused the problem; that’ll look for it in your servers root directory, which probabaly isn’t right.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
I’m experienceing the same issue. Trying to upgrade from ojs 3.0.2.0 to ojs 3.2.1-1. I also updated php from 5.64 to 7.2 as I understood the new ojs is compatibile with version >=7.2.

When I type:
php tools/upgrade.php
or
php tools/upgrade.php check
or
php tools/upgrade.php upgrade

I have no response (the terminal does not print anything to the screen).

Any idea about what could cause it?

BTW, under ojs 3.0.2.0 the php tools/upgrade.php works.

Thanks

Hi @erupnik,

Check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

do you mean the logs that are in /var/ ? Permission is denied :?

thank you!
ewelina

Hi @erupnik,

This will depend on your server, but see How do I find my PHP error log? for some general guidance.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher.

It looks like there’s no logging on: PHP 7.3.27 - phpinfo()

I tried to change it using the php.ini file, but again, I can only read it.

Any thoughts on that?

thanks,e

Hi @erupnik,

Are you running your own server, or is this a commercial service provider?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
It is an OVHcloud server. It is commercial therefore.
Thanks!
e

I also tried changing the php.ini variables via the .htaccess file:

enable PHP error logging

php_flag log_errors on
php_value error_log “/path/PHP_errors.log”

But the changes defined in .htaccess are not taken into account.

Hi @erupnik,

You’ll have to check the service provider’s knowledge base or contact them for information on how to access the PHP logs – unfortunately this will be provider-specific.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I partially solved the issue by changing mysql to mysqli in the config.inc.php file. Now the upgrade is launching, however, after a short while it throws an error:

[pre-install]
[load: upgrade.xml]
[version: 3.2.1.1]

[code: Installer Installer::checkPhpVersion]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]

What are your thoughts on that?

Thanks!
e

Hi @erupnik,

I don’t see an error there – that’s part of the normal output of the upgrade process. It looks like it was cut short, though. Did anything appear in the PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher, my bad, I forgot to copy the last line; here’s the entire output:

[pre-install]
[load: upgrade.xml]
[version: 3.2.1.1]

[code: Installer Installer::checkPhpVersion]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
ERROR: Upgrade failed: DB: Table ‘review_assignments_tmp’ already exists

Hi @erupnik,

The table review_assignments_tmp is created during the upgrade process as a temporary storage area, then deleted when the upgrade completes. If it already exists, it’s because a failed upgrade attempt left it behind.

When an upgrade fails, make sure to totally delete the database, create an empty one, then load it with the contents of a backup you took before running the upgrade.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher, indeed it helped to solve the problem! However, something else came up:
[pre-install]
[load: upgrade.xml]
[version: 3.2.1.1]

[code: Installer Installer::checkPhpVersion]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml]
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml]

[code: Installer Installer::migrateSubmissionCoverImages]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning_articleGalleySettings.xml]
ERROR: Upgrade failed: DB: La table ‘submission_galley_settings’ existe déjà

The database was restored to its state before the upgrade trials.

What do you think about that?

Thanks in advance

Hi @erupnik,

This is similar – that table is created during the upgrade, and doesn’t exist in OJS 3.0.2. Are you sure you’re restoring for a backup taken before the first upgrade attempt?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher, yes I’m restoring the database to a date before any upgrade was done. I repeated the recovery now and I can still see that the “submission_galley_settings” table in the db. Would it be okay to just delete it?

Hi @erupnik,

Does your OJS 3.0.2 database backup have a table called article_galley_settings? It shouldn’t – this should have been removed when you upgraded from OJS 2.x to 3.x. I’d recommend reloading your 3.0.2 database backup, dropping the article_galley_settings table, and trying the upgrade again.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher, thank you very much, removing the article_galley_settings did help me move forward in the upgrade. Then, it encounters yet another duplicate entry:

[code: Installer Installer::fixAuthorGroup]
[note: docs/release-notes/README-3.1.1]
[data: dbscripts/xml/upgrade/3.1.2_update.xml]
[note: docs/release-notes/README-3.1.2]
[data: dbscripts/xml/upgrade/event_log_oneclickuserid.xml]
[data: dbscripts/xml/upgrade/3.2.0_stylesheet.xml]
[data: dbscripts/xml/upgrade/3.2.0_archiving_settings.xml]
[data: dbscripts/xml/upgrade/3.2.0_update.xml]
[data: dbscripts/xml/upgrade/3.2.0_navigation_menu_items_locale_change.xml]

[code: Installer Installer::migrateSiteLocales]

[code: Installer Installer::migrateSidebarBlocks]

[code: Installer Installer::migrateSiteStylesheet]

[code: Installer Installer::migrateMetadataSettings]

[code: Installer Installer::createLicenseTerms]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::changeUserRolesAndStageAssignmentsForStagePermitSubmissionEdit]
[data: dbscripts/xml/upgrade/3.2.0_versioning.xml]
ERROR: Upgrade failed: DB: Duplicate entry ‘submissionSubject-1048588-90’ for key ‘controlled_vocab_symbolic’

Thanks again for your time!
e