The upgrade timed out and now I have missing columns in the database and the app complaints about it.
If during the upgrade process you get a timeout it is because your database is just too big and it takes too much time to run all the queries against your existing database.
In such case, the best is to restore your backup that you did before upgrading, and then do the upgrade again, this time from command line. If you don’t have a backup(you should though), then you might consider reinstalling the app, but if that’s not an option, what you can do, is to manually run all the queries that the upgrade process should have ran automatically for you.
MailWizz stores it’s upgrade sql files in /apps/common/data/update-sql/ folder and they are properly named after the version they upgrade to, so you will see files like 188.8.131.52.sql, 184.108.40.206.sql, 220.127.116.11.sql, 18.104.22.168.sql.
These are plain SQL files that can be ran against your database server. They don’t contain the table prefix (mw_ most likely) that you have selected during install, so you have to make sure that before executing these queries, you alter them properly so that you add their prefix.
So let’s say your app was at version 22.214.171.124 and you tried to upgrade to 126.96.36.199 and somewhere in the middle, the upgrade failed. We need to open the files 188.8.131.52.sql, 184.108.40.206.sql, 220.127.116.11.sql, 18.104.22.168.sql from /apps/common/data/update-sql/ and for each of the files, we have to manually run the queries from within( you can use the command line to run the queries or a tool like phpmyadmin).
In this case, the files 22.214.171.124.sql and 126.96.36.199.sql are empty, so there’s nothing to do for them. However, 188.8.131.52.sql contains this:
-- -- Alter the campaign table -- ALTER TABLE `campaign` CHANGE `subject` `subject` VARCHAR(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
So we have to run this query using the command line or phpmyadmin, but remember that first we have to add our selected table prefix to the above query. We will assume the prefix is mw_ so the above query becomes:
-- -- Alter the campaign table -- ALTER TABLE `mw_campaign` CHANGE `subject` `subject` VARCHAR(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
Now we can run it in phpmyadmin and move on to next file. In this case, 184.108.40.206.sql and 220.127.116.11.sql are empty, so we are done with running the queries.
Last step we have to do, is to empty the application cache, that is, empty, or rename, the folder /apps/common/runtime/cache.