Error upgrading: Invalid datetime format

Hy there

Might be interesting for you, Orlando_Alonzo, if you have not found a solution yet. In our case the problem was that the database character set (migrated from OJS 2.4 > ... > 3.2) had the wrong character set which caused problems migrating from 3.2 to 3.3.

What we have done

Changed the character set of the database and all tables. As we migrate the system to a new development machine, we started from scratch creating a new database with the correct character set and collation using:

CREATE DATABASE ojs CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

… and adjust the character set of the tables by manipulating an SQL dump following this guide: https://docs.moodle.org/31/en/Converting_your_MySQL_database_to_UTF8. This is for a moodle installation but explains what to do.

Altering existing tables

Alternatively you should be able to alter the database and the tables, something as (untested):

  • ALTER DATABASE mydatabasename charset=utf8mb4 COLLATE utf8mb4_unicode_ci;
  • ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8mb4;

utf8mb4 is a 4-byte version, utf8 itself an alias for 3-byte character encoding. Not sure if 4-byte is explicitly needed (?).

Greez
R

2 Likes