Upgrade failure (2.4->3.1)

I’m attempting to upgrade from version 2.4 to version 3.1. I’ve done the following as instructed in docs/UPGRADE.md:

If you have the CLI version of PHP installed (e.g., /usr/bin/php), you can upgrade the database as follows:

Edit config.inc.php and change “installed = On” to “installed = Off”
Run the following command from the OJS directory (not including the $): $ php tools/upgrade.php upgrade

It runs for a while, then dies with the following on the screen:

[data: dbscripts/xml/upgrade/3.1.0_update.xml]
ERROR: Upgrade failed: DB: Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘date_response_due’ at row 160

I previously tried upgrading from 2.4 directly to 3.3 but that would die complaining about a missing column in a database table. I was hoping I could go 2.4 → 3.1 and then 3.1 → 3.3 but it seems I can’t.

Any advice would be welcome, thanks.

Curious to know which “database table” is missing in your upgrade to 3.3, for me it’s complaining about Fatal error : Tables module does not exist in …/lib/pkp/lib/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModuleManager.php on line 188"

IIRC it was missing a field called context_id, but I can’t recall what table it was in.

Hi @Jafucius,

Your error messages involves tables as in HTML tables, not as in database tables. That’s a very different problem/question; I see you’ve also posted it over here. That’s the best place (and in the future it’s best not to post the same question in several places).

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi @pjohanneson,

Your best bet will be to upgrade from 2.x to the latest 3.2.x, then from there to 3.3.x when you’re ready. Try the 2.x to 3.2.x upgrade and see if it results in the same error message.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you @asmecher I will ask follow up questions in my own post, and I will try not to post twice.

I get the same results—same error, anyway—running the 3.2 updater. Everything seems to be all right, and then:

[data: dbscripts/xml/upgrade/3.1.0_update.xml]
ERROR: Upgrade failed: DB: Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘date_response_due’ at row 160

Looking at the database dump I’m using to pre-populate this instance of 2.4, I see that the edit_decisions table has the only 0000-00-00 00:00:00 in the SQL file. I’ll dig a bit more; maybe I just need to change those to approximately valid dates (like 2000-01-01 00:00:00 or something).

I don’t use OJS a lot (which might be obvious, since I’m trying to upgrade from 2.4). Are there logs generated by the upgrade script that I can try to look through?

Hi @pjohanneson,

This looks like a data error to me. Try the following SQL query on your 2.x database before running the upgrade:

UPDATE review_assignments SET date_response_due = NULL WHERE CONCAT(date_response_due) = '0000-00-00 00:00:00';

(Please make sure you have a good backup before working with the database directly.)

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

I’m working on a local server, getting the process down before I make changes on a production machine, so my data is safe.

The upgrade just completed – I changed 0000-00-00 00:00:00 in my db-dump.sql file to 2000-01-01 00:00:01 and re-imported the DB. (I wasn’t sure if those fields would allow NULL or not, so I used a long-past date instead.)

Now to try the update to 3.3. Thanks!