Upgrading Mattermost

Hi!

I have been reading the documentation at mattermost.com (important upgrade nodes, validity of esr, recommended ways and so on…) site for upgrading the service. We are not using the “dockered” version. I’m running 7.1.5 with Mysql 5.7.

By what I have read in the doc and in this forum it should be easy to upgrade Mattermost following Upgrade Mattermost Server — Mattermost documentation . As in previous versions I plan to use it but some doubts come to my mind about the process :

  • Due that the still valid ESR version is 8.1, I would say it would be fine to upgrade there. For achieving that goal, do I need to upgrade first to 7.8 and then to 8.1?.

  • In this link Important Upgrade Notes — Mattermost documentation, for 7.8 version talks about new tables creation " CREATE TABLE IF NOT EXISTS RetentionIdsForDeletion" but I was wondering if that create should be launched by the sysadmin or the own upgrade process handle that?. For some other versions, it talks too about doing other things than a simple select so… that changes should be done by the sysadmin or as commented is totally handled by the upgrade process?.

  • We have the following plugins in use (some of them installed by default), could you know if something is expected to be broken in the new version :

[root@mattermost-server tmp]# su mattermost -c ‘cd /opt/mattermost/bin ; /opt/mattermost/bin/mmctl --config /tmp/auth-token-file plugin marketplace list’

antivirus: Antivirus, Version: 0.1.2
com.mattermost.apps: Apps, Version: 1.1.0
mattermost-autolink: Autolink, Version: 1.2.2
com.mattermost.aws-sns: AWS SNS, Version: 1.2.0
com.mattermost.calls: Calls (Beta), Version: 0.10.0
com.mattermost.plugin-channel-export: Channel Export, Version: 1.0.0
com.mattermost.custom-attributes: Custom User Attributes, Version: 1.3.0
com.github.moussetc.mattermost.plugin.giphy: GIF commands, Version: 2.1.0
github: GitHub, Version: 2.1.7
com.github.manland.mattermost-plugin-gitlab: GitLab, Version: 1.7.0
jenkins: Jenkins, Version: 1.1.0
jira: Jira, Version: 3.2.5
jitsi: Jitsi, Version: 2.0.1
focalboard: Mattermost Boards, Version: 7.1.0
playbooks: Playbooks, Version: 1.29.3
mattermost-plugin-servicenow: Servicenow Plugin, Version: 2.3.4
com.mattermost.nps: User Satisfaction Surveys, Version: 1.2.0
com.mattermost.welcomebot: Welcome Bot, Version: 1.2.0
zoom: Zoom, Version: 1.6.2
There are 19 marketplaces on https://mattermost-reverse-proxy-server-name/

[root@mattermost-server tmp]# su mattermost -c ‘cd /opt/mattermost/bin ; /opt/mattermost/bin/mmctl --config /tmp/auth-token-file plugin list’

Listing enabled plugins
com.github.moussetc.mattermost.plugin.giphy: GIF commands, Version: 2.1.0
com.mattermost.apps: Apps, Version: 1.1.0
focalboard: Mattermost Boards, Version: 7.1.0
jitsi: Jitsi, Version: 2.0.1
playbooks: Playbooks, Version: 1.29.3

Listing disabled plugins
com.mattermost.calls: Calls (Beta), Version: 0.7.0
com.mattermost.plugin-channel-export: Channel Export, Version: 1.0.0
There are 9 plugins on https://mattermost-reverse-proxy-server-name/

I will explore all new features as calls plugin but… my main need is to have Mattermost upgraded for security reasons and just it to work the way is working today… basically that…

Do you think or could you know if I would have issues with this versions/env or is some sort of that known?.

I plan to test all these in a testing env but, just for having the experienced people ideas :slight_smile: :slight_smile:

Very thankful for your help and time,
Cheers!

Hi egoitzr, I too run mattermost without docker (I use LXD) and with mysql.
I’ve recently upgraded from 6.7.0 to 9.2.2 using this script mattermost-upgrade/update_mattermost.sh at main · fabolhak/mattermost-upgrade · GitHub

Here’s the output (I already had a full backup) :

update_mattermost.sh 9.2.2
[?] Do you want to clean backup directory [Y/n]
[-] Skipping cleaning
[?] Do you want to backup mattermost first? [Y/n] n
[-] Skipping backup
[+] Downloading Mattermost Enterprise "9.2.2"...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  421M  100  421M    0     0  11.0M      0  0:00:38  0:00:38 --:--:-- 11.2M
[+] The Mattermost update package has been downloaded with successful
[+] Extracting Mattermost update package...
[+] Stopping Mattermost service...
[+] Preparing update...
[+] Renaming plugin folders...
[+] Updating Mattermost...
[+] Cleaning Mattermost temporary files...
[+] Starting Mattermost service...
[+] Mattermost updated with successful
*************************************************
Dont forget to reactivate your plugins
mv "/opt/mattermost/plugins~" "/opt/mattermost/plugins"
mv "/opt/mattermost/client/plugins" "/opt/mattermost/client/plugins~"
*************************************************

After this I had to manually do these things for the database :

mysql -e"alter database mattermost COLLATE = 'utf8mb4_0900_ai_ci';"
mysql --batch --skip-column-names -e'show tables' |
while read table; do
    echo $table &&
    mysql -e "alter table $table COLLATE = 'utf8mb4_0900_ai_ci'"
done

and set

        AllowCorsFrom to "*"

in mattermost/config/config.json (not pretty of course)

Things like table creation of Reactions, RetentionIdsForDeletion were taken care of by some automation.
Don’t know about the plugins. Do make a backup first and test the restore of it :wink:

– Hans

edit: typo

Thank you so much for sharing Hans!!!

It’s nice to now Mattermost upgraded fine from that version to the newest one!

Cheers!

We are having a similar problem and questions as OP and wanted to use the provided script. We are going from 7.8.15 ESR to 8.7.1 ESR and tried running the script but we appear to have an issue with the “edition” variable.

Sorry, I hate to jump onto another post but this seemed like a similar issue we are having now. Any help on this would be greatly appreciated.

root@vm-mm-01:/# sh /tmp/updatemmv1.sh 8.1.7
/tmp/updatemmv1.sh: 42: [[: not found

# Specify the edition you use
edition="Enterprise"
#edition="Enterprise"

nvm, syntax error on my part. bash instead of sh. Would be great to know how your upgrade took since you are also going from 7.8 to 8.1. “Starting Mattermost service…” seems to hang there for quite some time.