Upgrade to 3.4.0-7 failed

Dear,

I am upgrading OJS from 3.1.1.2 to 3.4.0.7. During the upgrade I got following error:

ERROR: Upgrade failed: DB: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xC4\x8Ditev’ for column ojs.email_templates_settings.setting_value at row 7 (SQL:
INSERT INTO email_templates_settings (email_id, locale, setting_value, setting_name)
SELECT email_id, locale, subject, ‘subject’
FROM email_templates_data
)

How to solve this?

Regards, Primoz

Hi @primozs,

It looks like your database contents might not be correctly encoded. \xC4\x8Ditev corresponds to the UTF-8 text čitev, which appears in a few of the OJS emails as part of e.g. odločitev. I’m not sure where the datetime part of the error came from, but I suspect your database is rejecting what it sees as an incorrectly encoded UTF8 string.

You might try looking through a database dump from your OJS 3.1.1.2 version for odločitev to see how it is encoded before you try to run the upgrade. You might need to correct the encoding first. This is more of a database administration task than an OJS task, so you might find guidance e.g. on StackOverflow.

There are some threads about this here in the forum as well – I would just caution against one-by-one correction of incorrectly coded characters, as you will quickly end up in a tangle of partially corrected data. You’ll want to find a way to run your database through a conversion tool like ftfy or iconv.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

I waited with the answer until I finished the upgrade. You were right, the issue was with the encoding. The new DB has been setup with the Latin1 encoding, while the old was UTF. After changing the encoding of the new DB to the UTF the error has gone.

Thank you!

Regards, Primož

1 Like

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