While trying to upgrade to an MM version >= 6.0.x, you might encounter an error of the form:
Failed to alter column type. It is likely you have invalid JSON values in the column. Please fix the values manually and run the migration again.
This means the particular column has some invalid JSON values which need to be fixed manually. A common fix that has known to work is to wipe out all \u0000
characters.
Follow these steps:
- Check the affected values by:
SELECT COUNT(*) FROM <table> WHERE <column> LIKE '%\u0000%';
- If you get a count more than 0, check those values manually, and confirm they are okay to be removed.
- Remove them by
UPDATE <table> SET <column> = regexp_replace(<column>, '\\u0000', '', 'g') where <column> like '%\u0000%';
Then try to start Mattermost again.