Debug School

Cover image for Upgrade Mattermost Server
Suyash Sambhare
Suyash Sambhare

Posted on

Upgrade Mattermost Server

How to upgrade an on-premise installation of the Mattermost server

Prerequisites

  • Install directory: Use the whereis mattermost command to find standard binary places and $PATH. Usually, Mattermost is installed in /opt/mattermost
  • Storage used: The local storage directory contains all the files that users have attached to their messages. Paths are relative to the mattermost directory. So, if the local storage directory is ./data/ then the absolute path is /opt/mattermost/data
  • Database disk space: A minimum 2GB of free disk space is required and a minimum of twice the size of your Mattermost installation available for the database.

Ganga

Upgrade Mattermost Server

  1. ssh to your Mattermost Server
    ssh ubuntu@mattermost.testserver.com

  2. Change directory to /tmp
    cd /tmp

  3. Delete all other files from /tmp
    rm -rf

  4. Download the latest version of Mattermost Server
    For Enterprise Edition
    wget https://releases.mattermost.com/X.X.X/mattermost-X.X.X-linux-amd64.tar.gz
    Eg. wget https://releases.mattermost.com/7.8.0/mattermost-7.8.0-linux-amd64.tar.gz
    For Team Edition
    wget https://releases.mattermost.com/X.X.X/mattermost-team-X.X.X-linux-amd64.tar.gz
    Eg. wget https://releases.mattermost.com/7.8.0/mattermost-team-7.8.0-linux-amd64.tar.gz

  5. Extract files
    tar -xf mattermost*.gz --transform='s,^[^/]\+,\0-upgrade,'

  6. Stop Mattermost server
    sudo systemctl stop mattermost

  7. Back up your data and application

  8. 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

  9. Copy new files to your install directory
    sudo cp -an /tmp/mattermost-upgrade/. mattermost/

  10. Change ownership
    sudo chown -R mattermost:mattermost mattermost

  11. Start Mattermost server
    sudo systemctl start mattermost

  12. Cleanup
    sudo rm -r /tmp/mattermost-upgrade/
    sudo rm -i /tmp/mattermost*.gz

After the server is upgraded, users might need to refresh their browsers to experience any new features.

Note: Some instances of Mattermost server might face issue after upgrade where the service does not start after upgrade. To resolve this, uncheck the Custom Emoji option from System Console and then perform the upgrade.

Ref: https://docs.mattermost.com/upgrade/upgrading-mattermost-server.html

Top comments (0)