Do you know how to properly upgrade from OJS 3.2.1-2 to OJS 3.3.0-7?

I didn’t have exactly the same error as you, but I think it may be connected with one mistake I made many times before I understood an important thing I told about in the end of my first post in this thread (let me quote myself):

So be sure you do it like that ! Restore the old database from backup (made before your upgrade-attempts), fix things (with “MYISAM vs InnoDB” or whatever you want to “fix”) and start upgrade script. Don’t try to start this script again on a half-upgraded database (after the failed attempt)!

2 Likes

@Dip ;

Thanks for sharing about this MyISAM and InnoDB functions. It is a big help for me, my old database was successfully upgraded to OJS version 3.3.0-8 but not the complete files backup upgraded because my old database was on 2019, which is 10 volumes its uploaded on the broken database which I am fixing right now, if I can’t resolve this maybe I will move on and re upload the delayed volumes instead of focusing on upgrading the broken database.

But, I will try my best also to fix this broken database and understand the flow.

Thanks for your kindness,

Darryl

We have a similar error code when trying to upgrade from 3.2.1-4 to 3.3.0-8:

ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1005 Can’t create table umassed_dev_ojs.submission_files (errno: 150 “Foreign key constraint is incorrectly formed”) (SQL: alter table submission_files add constraint submission_files_file_id_foreign foreign key (file_id) references files (file_id))

We still get this error after changing each table in the database to InnoDB and collation to utf8_general_ci. The database itself, however, apparently has a default of MyISAM, despite each table being set to InnoDB.

Could this be our issue? We don’t have privileges to change the default storage engine for databases ourselves, so we would have to submit a ticket to make this change.

Likely.

There is a workaround, e.g., adding 'engine' => 'InnoDB' after this line: https://github.com/pkp/pkp-lib/blob/d60b0e99db3eaf5e10227d818642ae127a67ef43/classes/core/PKPApplication.inc.php#L219 before running the upgrade script.
But it’s better and more consistent to change it on the database configurations side.

3 Likes

@Vitaliy ,

That workaround did the trick! The site is working and updated to 3.3.0-8.

Thank you!

2 Likes