Errors upgrading from OJS 3.1.2.1

Hello everyone, I’m new to the OJS community. I’m trying to upgrade from version 3.1.2.1 to more recent versions. I’ve made several different attempts, but every time (even just to 3.1.2.2) I get database upgrade errors, such as:

ERROR: Upgrade failed: DB: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'email_id' (SQL: ALTER TABLE email_templates_data ADD email_id BIGINT)

I also tried doing a clean installation of version 3.1.2.1 to verify if the database structure was correct. But even upgrading from the clean install (just as a test), I get the same errors when trying to update to any newer version.

Has anyone encountered this issue or knows how to resolve it? Any help would be greatly appreciated. Thanks!

Hi @qra,

The OJS 3.1.2-1 database does not have a email_id column on the email_templates_data table. If your backup shows that table as having a column called email_id, it must’ve been added by either something outside of OJS, or by a failed upgrade that wasn’t restored from backup. You could try removing that column, but if it was a failed upgrade, you’ll probably run into other problems.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for your reply.

I’ve read also this thread [OJS 3.1.2.0 to 3.2] Upgrade Error - Duplicate column name ‘email_id’ and this describes exactly my experience.

Does exist a solution?

Hi @qra,

Can you clarify whether your pre-upgrade database backup has that column?

Regards,
Alec Smecher
Public Knowledge Project Team

La traduzione in inglese è:

No, the table does not contain it before the upgrade.