Mattermost Upgradation
Mattermost Upgradation
Upgrade Mattermost Server
[edit]Step 1
Take a backup of the server and delete files and directories which are with old version.
cd /tmp
Step 2
Download the latest version of mattermost server.
wget https://releases.mattermost.com/X.X.X/mattermost-X.X.X-linux-amd64.tar.gz
Replace x.x.x. With the version you want to download in the above command
Step 3
Confirm no other version zip file exists in the /tmp folder. If exists delete or rename them
Step 4
Extract the downloaded files using below command.
tar -xf mattermost*.gz --transform='s,^[^/]\+,\0-upgrade,'
Step 5
Stop mattermost server
sudo systemctl stop mattermost
Step 6
Copy the downloaded file to the installed path as below
cd {install-path}
sudo cp -ra mattermost/ mattermost-back-$(date +'%F-%H-%M')
Step 7
Remove all files except data and custom directories from within the current mattermost directory.
sudo find mattermost/ mattermost/client/ -mindepth 1 -maxdepth 1 \! \( -type d \( -path mattermost/client -o -path mattermost/client/plugins -o -path mattermost/config -o -path mattermost/logs -o -path mattermost/plugins -o -path mattermost/data \) -prune \) | sort | sudo xargs rm -r
Step 8
Copy the new files to your install directory.
sudo cp -an /tmp/mattermost-upgrade/. mattermost/
Step 9
Change the ownership of the files
sudo chown -R mattermost:mattermost mattermost
Step 10
Start mattermost server
sudo systemctl start mattermost
Step 11
Remove temporary files in /tmp folder
sudo rm -r /tmp/mattermost-upgrade/
sudo rm -i /tmp/mattermost*.gz