Downgrade Mattermost Server
In most cases you can downgrade Mattermost Server using the same steps as upgrading mattermost server. Server binaries can be found in the Mattermost server version archive documentation.
Prepare for downgrade
Before downgrading the Mattermost server, we strongly recommend the following preparation steps.
- Back up your data: Ensure you have a full backup of your database and Mattermost application files. This is crucial in case you need to revert any changes.
- Back up your database using your organization’s standard procedures for backing up the database.
- Back up your application by copying into an archive folder (e.g.
mattermost-back-YYYY-MM-DD-HH-mm). Ensure to copy your Mattermost configuration files and any other necessary application files.
- Carefully review the Mattermost changelog for the version you are downgrading to in order to understand any potential issues or incompatibilities.
- Verify the current schema version of your database using the mattermost db version --all command. Also, if you aren't sure about the target schema, you can verify the target schema version (i.e., applied migrations) by checking the public GitHub repository (Select the tag for desired version).
Perform the downgrade
- Stop the Mattermost service to ensure that no data is being written to the database during the downgrade process.
- If the database schema has changed between versions, you must downgrade the schema. Use the newer mattermost binary to perform the downgrade using the mattermost db downgrade command. For example:
mattermost db downgrade 128,127,126
- There may be changes in configuration settings between versions. Revert any necessary configuration changes in the
config.jsonfile to match the downgraded version's expectations and support.
After the downgrade
Replace the current Mattermost application binary with the version you want to downgrade to. Make sure to use the binary of the target version. The newer Mattermost binary contains the downgrade SQL for the migrations to be rolled back. The newer binary version is used to perform the downgrade; then you start using the application binary of the version you want to downgrade to.
- Restart the Mattermost Server after completing the downgrade.
- Check the logs and test the application to ensure that everything is functioning correctly.
- Inform your users about the downgrade and any potential changes they might experience.