Skip to content

5.x Update Quirks

Schlaefer edited this page Apr 13, 2020 · 10 revisions

What

Issues that makes the auto-updater fail.

Why

  1. Database is very old (a decade and maybe even originating in mylittleforum). This introduces DB inconsistencies the updater is not expecting and prepared to handle, resulting in an update failure.
  2. Database is large (300.000+ postings). With that the DB may take a long time to execute the update commands and the PHP script times out before the DB is finished.

General Tips

Check logs/saito-install.log for hints if the update fails.

Do one 5.x update at a time to minimize potential issues.

5.0 to 5.1

Fail

MySQL runs in strict mode and requires valid dates

Run manually before the update:

SET SQL_MODE='ALLOW_INVALID_DATES';
ALTER TABLE entries MODIFY created datetime NULL;
UPDATE entries SET created = NULL WHERE created < '0000-01-01 00:00:00';
SET SQL_MODE='ALLOW_INVALID_DATES';
ALTER TABLE entries MODIFY modified datetime NULL;
UPDATE entries SET modified = NULL WHERE modified < '0000-01-01 00:00:00';

Timeout

Removing entries.email_notify

Remove field email_notify manually before update start.

5.2 to 5.3(.1)

Fail

Double DB records for uploads

Check that there are not double uploads in the DB:

SELECT name, user_id, COUNT(*)
FROM uploads
GROUP BY name, user_id
HAVING COUNT(*) > 1

If so delete them:

DELETE table1 FROM uploads table1
INNER JOIN uploads table2 
WHERE 
    table1.id < table2.id AND 
    table1.user_id = table2.user_id AND 
    table1.name = table2.name;

Timeout

Change entries table to InnoDB

Convert the table manually:

ALTER TABLE entries ENGINE=InnoDB;

Skip the step in the updater by removing/disabling the following line in config/Migrations/20190729142650_Saitox5x3x0.php

        $this->execute('ALTER TABLE entries ENGINE=InnoDB');