Mattermost, Inc.

Help recovering history

I was running Mattermost 4.0 on CentOS 7 with MariaDB 5.5. I downloaded 5.22.1 and followed the upgrade instructions.

However, I got the following error:

"sqlstore/supplier.go:886","msg":"Failed to create index",
"error":"Error 1071: Specified key was too long; max key length is 1000 bytes"}

I googled that and found some suggestions, which I implemented but none of them worked. One of the things i did was upgrade to MariaDB 10.4.

So i moved the 5.22 directory to another folder and moved the backup directory to mattermost.

But now I get this error:
[CRIT] The database schema version of 5.22.0 cannot be upgraded. You must not skip a version.

I thought upgrading from 4 to 5 was allowed (not considered skipping a version).

Any help would be appreciated.

I noticed that the fix to the key length problem involved some settings for InnoDB in MariaDB. My tables were using engine=MyISAM. Altering the tables to use engine=InnoDB fixed my problem, in that it allowed me to upgrade to 5.22.

Lesson to self (and others) make a backup of your DB before upgrading so you can roll back if necessary.