bchmattermost

Upgrade Mattermost Team Edition

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

It is strongly recommended to create a backup before starting the update process. If you have important data, create and restore a backup to ensure that everything works properly.

Follow these steps to upgrade Mattermost:

  • Stop the server:

      $ sudo /opt/bitnami/ctlscript.sh stop mattermost
    
  • Navigate to the Mattermost installation directory. Depending on your installation type, execute the following commands:

    • Approach A (Bitnami installations using system packages):

        $ cd /opt/bitnami/mattermost
      
    • Approach B (Self-contained Bitnami installations):

        $ cd /opt/bitnami/apps/mattermost/server
      
  • Back up the current configuration files:

      $ mkdir ~/backup
      $ cp config/config.json ~/backup/
    
  • Back up the database as described on the MySQL page.

  • Back up the Mattermost data files:

      $ cp -r data ~/backup/
    
  • Download the latest version of Mattermost:

      $ cd ..
      $ wget https://releases.mattermost.com/X.X.X/mattermost-team-X.X.X-linux-amd64.tar.gz
    
  • Remove previous Mattermost files (already backed up in previous steps).

      $ rm -rf mattermost/*
    
  • Uncompress the new version:

      $ tar xzf mattermost-team-X.X.X-linux-amd64.tar.gz -C mattermost --strip-components=1
    
  • Restore the previous configuration file:

      $ cd -
      $ cp ~/backup/config.json config/config.json
    
  • Adjust file permissions as below:

      $ chown -R bitnami:mattermost .
      $ sudo chown -R mattermost:mattermost logs client data
    
  • Restart the server:

      $ sudo /opt/bitnami/ctlscript.sh restart mattermost
    
  • Open the “System Console” and save a change. Doing this will upgrade your config.json schema to the latest version using default values for any new settings added.

Last modification September 16, 2021