Column not found when upgrading from 3.1 to 3.3

I’m working on upgrading my OJS version from to the latest as you can see below

$ php tools/upgrade.php check
Code version:
Database version:
Latest version:
Database version is older than code version
Run "tools/upgrade.php upgrade" to update

However, I do receive this error consistently

[load: upgrade.xml]
[code: Installer Installer::checkPhpVersion]
[code: Installer Installer::migrateSubmissionCoverImages]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml]
ERROR: Upgrade failed: DB: SQLSTATE[42S22]: Column not found: 
1054 Unknown column 'etd.email_id' in 'field list' 
(SQL: UPDATE email_templates_data etd LEFT JOIN email_templates et ON 
(etd.email_key = et.email_key 
    AND etd.assoc_type = et.assoc_type 
    AND etd.assoc_id = et.assoc_id
SET etd.email_id = et.email_id)

I checked my DB, and I only have the column email_key in that table. The SQL query mentioned above seems a bit wrong.

Any advice or help?

Right before that query is run, the email_id column should be added. See: ojs/3.2.0_preupdate_email_templates.xml at main · pkp/ojs · GitHub

What database and version are you using? Maybe the alter table statement is failing?

Thanks for the reply Nate. For some reason I didn’t receive a notification to answer you faster.

I’m using MySQL, precisely mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper.

Re-did the upgrade steps by re-checking the OJS Git files I used. It turned out I had a couple of problems in the upgrade files.
Now, I’m passed that error.

1 Like

This topic was automatically closed after 6 days. New replies are no longer allowed.