Docker upgrade from 4.0.0 to 4.0.1 or 4.0.2 fails with mysql error

If you still can’t get it to work then I would take your pre-upgrade backup, dump the data with mysqldump, stop the containers, move shared/db to shared/db_old, and put your database dump as shared/backup/import.sql.

Then do the upgrade, and your backup will be loaded in to a clean MySQL database and it should all be fine from there.