I am trying to update ojs from 22.214.171.124 to 126.96.36.199, but I get the following error:
ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1005 Can’t create table ‘ojs33010.#sql-3de_bcfeba’ (errno: 150) (SQL: alter table
submission_files add constraint
submission_files_file_id_foreign foreign key (
Before updating, I changed all tables into InnoDB, because some tables were MyISAM, as suggested in other threads related to this issue, but it doesn’t help. Upon the update breaks, some of the tables go back to MyISAM. Additionally, before this error comes up, there are a few following, not sure if related to the one above:
A file assigned to the file stage 1 could not be migrated.
A submission file was expected but not found at …
Thanks for suggestions.
You need to grant REFERENCES permission for your database user.
GRANT REFERENCES ON `database_name`.* TO 'database_user'@'localhost';
I checked and my user has this permission granted.
I missed one thing apparently:
'engine' => 'InnoDB',
according to this thread: UPDATING Problem from 188.8.131.52 to 184.108.40.206 - #17 by Vitaliy
Will check the update process again.
Applying the missing line helped, and the update succeeded.
how did you manage to solve it? I’m having this problem too
Upon duplication 220.127.116.11 database that would serve as a source for 18.104.22.168, I changed storage engine for all MyISAM tables into InnoDB. Next, I added
'engine' => 'InnoDB',
in /lib/pkp/classes/core/PKPApplication.inc.php, ahead of
'driver' => $driver,
Then I started regular ojs update.
If you are updating from the earlier versions of ojs, you might need to update through intermediate versions, and if so you might check my other issue: Issues upon upgrading ojs from 22.214.171.124 to 126.96.36.199
Did you use any command to change all tables to InnoDB?
I altered each table individually with
ALTER TABLE table_name ENGINE = InnoDB;
You can check storage engine of each table in phpMyAdmin in the Structure tab of a database you want to alter (“Type” column). Next, in the SQL tab you can run the above command.
Alternatively to sql command, you may change the storage engine also in phpMyAdmin in each table’s Operation tab > Table Options section > Storage Engine option.
Hello, thank you I changed the tables and updated to the latest version and now it worked!