Upgrade Error -OJS 3.2.1.4 to 3.3.0

Hello,
Please help me to upgrade OJS OJS 3.2.1.4 to 3.3.0.
I am received this error

[back@ap ojs.example.com]$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.3.0.4]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::installDefaultNavigationMenus]

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[migration: PKPv3_3_0UpgradeMigration]
ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table submission_file_revisions add constraint submission_file_revisions_submission_file_id_foreign foreign key (submission_file_id) references submission_files (submission_file_id))

Please help me

Regards,
Aditya B

Hi @adityab2

I think the easiest approach is:

  1. Make a backup of your database and make sure it works.
  2. Drop all your MySQL tables through PHP MyAdmin.
  3. Import the backup you made in step 1 with the following parameter:
    mysql --init-command=“SET SESSION FOREIGN_KEY_CHECKS=0;” -u DBUSER -p DBNAME < DATABASE-BACKUP.sql
  4. Try to run the upgrade.

Best regards,

Josh Noronha (he, him, his)
Systems Administrator
PKP|PS Support Team

Hello @jnoronha
Thank you.
I decided to change the status of the submission_files table:

ALTER TABLE submission_files ENGINE = InnoDB; and

I have used: php -d memory_limit=800M tools/upgrade.php upgrade

Upgraded successfully from 3.2.1.4 to 3.3.0.11.

Thank you

1 Like