Downgrading Mattermost and rolling back a failed upgrade

A failed Mattermost upgrade can leave the database schema on a newer version than the binary you are running. This page explains how to downgrade Mattermost safely, which backups and checks come first, and what a rollback costs in time and effort.

On this page

How to downgrade Mattermost after a failed upgrade

An upgrade has failed or behaves badly in production, and the team has to decide quickly whether to restore from backup or downgrade the server binary. Mattermost does not recommend downgrading more than one major version, and it advises testing the downgrade in staging before touching production. Treat a downgrade as a change in its own right: write down the version you are returning to, who approves it, and how you will confirm the service is healthy afterward.

The rollback path depends on whether the database schema changed during the upgrade. Run mattermost db version --all against the database to see the schema versions the newer binary has applied. If the schema did not change, reverting the binary may be enough. If it did change, you must downgrade the schema with the newer binary before starting the older one, so the two stay in step. Confirm this sequence against the Mattermost downgrade documentation for your exact versions, and do not assume the steps are identical across releases.

The upgrade procedure itself, including pre-upgrade checks and backups, is covered on the sibling upgrade pages, so this section assumes you already have a backup and a known-good binary. Before you begin, confirm that the backup includes both the PostgreSQL database and the file storage, and that you can restore both to a staging environment. Record the plugin versions in use, since plugin compatibility may differ between the two releases and can determine whether the downgrade is workable at all.

Which rollback path fits your failed upgrade

This table matches the point where an upgrade failed to a rollback path and the first check to run. Read it by finding your situation in the left column, then following the row across. Across every row, the main takeaway is that the one-major-version limit and a staging test come before any production downgrade.

SituationRollback pathWhat to check first
Failure before the new binary startedRestore the previous binary and configuration. No schema change should need reversing if the new server never ran.Confirm the schema version with mattermost db version --all before touching the database, and keep the old binary available.
Failure after schema migrations ranDowngrade the schema with the newer binary, then start the older binary. Mattermost says to downgrade the schema with the newer binary when it changed.Run mattermost db version --all to see whether the schema changed, and rehearse the downgrade in staging first.
Failure after users wrote data on the new versionPlan a downgrade with the data written since the upgrade in mind. Confirm with Mattermost whether the older schema can read those records before deciding.Confirm the backup you would restore from, and ask whether the post-upgrade writes survive the schema downgrade.
Target more than one major version backNot a supported single-step downgrade. Mattermost does not recommend downgrading more than one major version.Identify the intermediate major version, and plan a restore from backup or a staged path with Mattermost's guidance.
Multi-node or high availability clusterStop or drain nodes in a planned order, then downgrade the schema once with the newer binary before bringing the older binary up on each node.Confirm that every node runs the same version, check shared file storage, and rehearse the full sequence in staging.

Decision path from failed upgrade to recovered server

The path starts when an upgrade fails and Mattermost is stopped before anything else changes. The key hand-off is the schema check with the database version command: if the schema did not change, the newer binary can simply be replaced; if it did, the schema is downgraded with the newer binary, and that is only viable within the one-major-version limit Mattermost advises. If the downgrade is not viable, the backup taken beforehand is restored. Every route ends with verification and a retest in staging before users return.

Decision path from a failed upgrade to a verified, recovered Mattermost server.

What to back up before any Mattermost upgrade

A rollback only works if you can return the database, files, configuration and binary to a state that matches each other. The cards below cover the five inputs to capture before an upgrade, and what to confirm in your own environment before you rely on them.

PostgreSQL database

The database holds messages, users, channels and the schema version that the binary checks at startup. A downgrade rewinds the schema with the newer binary, but it cannot restore data written after the upgrade began, so a consistent database dump taken with Mattermost stopped is your fallback. Confirm that you can restore it into a scratch PostgreSQL instance and that the restored schema reports the expected version before the upgrade window opens.

Downgrade docs

File storage location

Uploaded files, images and attachments live outside the database, either on local disk for a single server or on shared storage in a cluster. Database and file backups must describe the same point in time, or messages will reference files that no longer exist. Confirm where your file store lives, how it is captured alongside the database, and whether a restored copy can be mounted by the rollback target.

Configuration file

The server configuration file controls database connection, file storage, site URL, authentication and plugin settings. Newer releases can add or rename keys, so the old file may need to be paired with the old binary during a rollback. Keep a dated copy of the file as it stood before the upgrade, and confirm that your configuration management can reproduce it on a clean host.

Installed plugins and versions

Plugins record their own versions and may run database migrations on first start. A plugin built for the newer server may not load on the older binary, and a plugin upgraded before the rollback may not match the restored schema. Record each plugin name, version and source before upgrading, and confirm whether each plugin can be reinstalled at the prior version in your environment.

Binary or package version in use

The rollback target is the exact server binary or package you ran before the upgrade, so keep it, not just its version number. Store the archive or package file with its checksum, and confirm that your package repository still serves that version. Without the old binary, you cannot run the schema downgrade that Mattermost documents, and the rollback stalls at the database.

Checking the schema version before you downgrade

The first rollback check is the database schema version, because it decides whether a downgrade needs a schema step at all. Run mattermost db version --all against the production database and record the output before you start the upgrade. The documented guidance is to check the schema with this command and to downgrade the schema with the newer binary only when the schema actually changed. If the version has not moved, the older binary can usually be restored without touching the database. If it has moved, the newer binary must be used for the schema step, so a rollback plan that only restores the old binary will not be enough.

Read the output as a list of schema versions, one per relevant table or migration group, and treat it as a record to compare rather than a value to memorize. The useful question is whether the values you see now match the values you saved before the upgrade. Store the before and after outputs with the change record, along with the binary version and the backup identifier they belong to. Confirm the exact output format for your release in the Mattermost downgrade documentation and in staging, since the reader should not assume the layout from a single example.

Compare the recorded schema state with the version you intend to return to, not with the version you are leaving. Mattermost does not recommend downgrading more than one major version, so the target release must be close enough to the current schema that the documented downgrade path applies. If the target is more than one major version back, or if the schema state does not correspond to any release you can install, stop and escalate before running anything against production. Keep the Mattermost downgrade documentation open during this comparison and test the same steps in staging first.

Rolling back a Mattermost upgrade in order

This sequence returns a Mattermost server to its previous version by stopping the application, taking a fresh database backup, reverting the schema with the newer binary, and then running the older binary against a verified database. Each step ends with a check so the team knows whether to continue or stop.

  1. Stop all application servers

    Stop every Mattermost application server so that nothing writes to the database while you work. In a single-server install this is one service. In a cluster, stop every node, not just the one you are working from, and confirm that no process is still listening on the Mattermost port. Keep the newer binary and its configuration files in place, because you will need the newer binary for the schema step. Check: no node responds to health checks and no Mattermost process is running on any host. If any node still accepts connections, do not continue, because the backup and schema check would then be taken against a moving database.

  2. Take a fresh database backup

    Create a new backup of the PostgreSQL database in its current state, after the application has stopped. Do not rely on the backup taken before the upgrade, since users may have written data since then. Also copy the configuration file, plugin directory and file storage location so the environment can be reconstructed if needed. Confirm the backup completes without errors and that you can list its contents or restore it into a scratch database. Rollback point: this backup is your recovery path if any later step leaves the database in an unexpected state, so store it somewhere separate from the server being rolled back.

  3. Check the schema version

    Run the schema version check documented for the Mattermost command line tool, which reports the schema version recorded for each migration path. Compare the output with the version you are reverting to. Mattermost's downgrade guidance says to run this check first, and only a schema that changed in the newer release requires the downgrade step. Record the output in your change ticket. Check: you can state which schema version the database is on and which version the target binary expects. If the output does not match what you expected from the upgrade record, stop and investigate before changing anything.

  4. Downgrade the schema with the newer binary

    If the schema check shows that the database changed in the newer release, downgrade the schema by running the downgrade command from the newer Mattermost binary, not the older one. Use the exact command and flags from the official downgrade documentation for your version pair, and do not reconstruct them from memory. Mattermost advises against downgrading more than one major version. Check: rerun the schema version check and confirm the database now reports the schema version of the target release. Rollback point: if the downgrade fails partway, restore the backup from the previous step into a clean database rather than trying to repeat the command against a partly changed schema.

  5. Install the target binary

    Install the older Mattermost binary that you are rolling back to, placing it alongside or in place of the newer one and restoring the configuration file that matches that version. Keep the newer binary archived so you can retry the upgrade later. Confirm that file ownership, service definitions and plugin files match what the older release expects. Plugins built for the newer release may not load on the older server, so review the plugin inventory before starting. Check: the binary reports the target version when invoked directly, and the plugin list matches the plugins you have validated for that release.

  6. Start the server and watch the logs

    Start one Mattermost application server first and watch its logs during startup. Look for schema or migration errors, configuration warnings and plugin load failures. Start additional cluster nodes only after the first node is healthy. Confirm that the server answers its health check and that the system console reports the expected version. Rollback point: if startup errors indicate a schema mismatch, stop the server again, keep the backup intact and do not start further nodes. The first node is the only one that should touch the database during this phase.

  7. Verify the restored service

    Test the environment as users will use it. Sign in through your configured identity provider, post and read messages in a channel, upload and download a file, confirm that integrations and plugins respond, and check that search returns results for recent messages. Review the server log for errors over a period of normal use. Check: each test passes and the log shows no new errors. Write the outcome, the versions in use and the backup location into the change record. If any test fails, treat the rollback as incomplete and return to the backup point rather than making ad hoc changes in production.

  8. Rehearse the full sequence in staging first

    Before any production rollback, run this entire sequence in a staging environment built from a recent production backup, using the same versions, plugins and configuration. Time each step, note which commands and checks differ from the documentation, and confirm that the staging restore reproduces the production schema state. Mattermost recommends testing a downgrade in staging for this reason. Check: the staging run finishes with a passing verification and a written runbook that the operators used. Ask the team that owns the production environment to review the runbook before the change window opens.

Plugins and password hashing after a rollback

Plugins are compiled against a specific server version, so a plugin you installed or updated while running the newer binary may not load on the older server after you downgrade. The server can start cleanly and still fail to run a plugin's features, which makes this easy to miss in a quick post-rollback check. Treat each plugin as a separate compatibility question and confirm it against the exact target version before you roll back.

  • Inventory every plugin: List installed plugins, their versions and whether each was updated during the failed upgrade.
  • Check the target version: Confirm with the plugin publisher that the build you need supports the server version you are returning to.
  • Restore the matching build: Keep the previous plugin package alongside the server backup so you can reinstall it in step with the binary.
  • Test the features that matter: Exercise the plugin functions your teams rely on in staging, not only whether the plugin appears in the console.
  • Plan for custom plugins: Plugins your own developers built may need a rebuild for the older server, so confirm that work before the rollback window.

Before rolling back, confirm the compatibility of every plugin against the target server version in a staging copy.

What makes a Mattermost rollback take longer

This table compares the factors that stretch a Mattermost downgrade or rollback and what each one changes in the effort required. Read each row as a question to answer before the upgrade starts, because most of these drivers are fixed by the time a failed upgrade is discovered. The main takeaway is that a rollback is fastest when a recent, tested backup exists and the schema change has been identified in advance.

DriverEffect on rollback effortWhat to check
Database size and restore timeLarger databases take longer to restore from backup, which extends the outage window while users are offline.Measure how long a full restore takes in staging, and confirm the backup was taken with Mattermost stopped.
Number of plugins and custom integrationsEach plugin may need an older build to match the restored version, adding packaging and testing steps.Keep a record of installed plugin versions and confirm each older build is still available.
Whether the schema changedA schema change means the database must be downgraded with the newer binary before the older binary starts, adding a step that can fail.Run mattermost db version --all before and after the upgrade to see whether the schema moved.
Number of nodes in a clusterEach application node must be returned to the older version in a coordinated way, so more nodes mean more steps and more chances for mixed versions.Document the order of node changes and confirm how the cluster behaves while versions are mixed.
Data users wrote on the new versionContent, settings or fields created after the upgrade may not map cleanly back to the older schema, so some work may be lost or need manual handling.Decide in advance whether post-upgrade data is kept, exported or accepted as lost, and confirm with the business owner.
Whether a staging environment existsWithout staging, the first real test of a downgrade happens on production, where mistakes take longer to undo.Confirm a staging copy of the database and configuration exists and that a downgrade has been rehearsed on it.

Questions teams ask before a Mattermost rollback

Can we downgrade Mattermost without restoring from a backup?

Sometimes, but only when the database schema has not changed in a way the older binary cannot read. Mattermost advises checking the schema first with mattermost db version --all. If the schema changed in the newer release, the documented approach is to downgrade the schema using the newer binary before you run the older one. Mattermost also does not recommend downgrading more than one major version, so a multi-version rollback usually means a restore plus a planned upgrade path. Confirm the exact schema behavior for your starting and target versions against the Mattermost downgrade documentation and rehearse it in staging before you rely on it in production.

What does a Mattermost rollback cost, and what drives the price?

The cost is mostly labor and the time your own staff or a partner spends on the work, plus any infrastructure needed for a staging copy. Mattermost does not publish service prices, and DeployOpen does not publish a price list. A quote follows from a written scope. The main drivers are the number of nodes, whether the deployment is a single server or a high availability cluster, the size of the database and file store, the number of plugins that need checking, and whether a staging environment already exists. Ask any provider for a quote that separates the one-time rehearsal, the rollback itself, and any follow-up testing, and state which backup and restore tools are assumed to be available.

How long does a rollback take?

The duration depends on how much data must be restored or converted, how many components must be stopped and started, and how many plugins need to be confirmed. No duration figure is supplied for this topic, so treat any number you receive as an estimate to verify. The largest variables are database size and file storage size, because both affect backup restore time and any schema work. A high availability cluster adds coordination across application servers, database servers and load balancers. Plugins add time when a plugin must be reinstalled or its compatibility confirmed. Ask the provider to state which of these factors they assumed and to rehearse the procedure on a copy of your production data.

What does a rollback need from our internal team?

A rollback needs named people who can make decisions during the window and who know your environment. At minimum, you need someone who controls the database credentials and backups, someone who can operate the reverse proxy and DNS, someone who owns plugin installs and configuration, and a business owner who can approve a return to service. Your team should also keep a written record of the versions in use, the backup locations and the steps tested in staging. Confirm the availability of these people before the upgrade window, since a rollback during an incident is much harder to coordinate than one planned in advance.

Do we need to check plugins before downgrading?

Yes. Plugin compatibility is one of the first things to verify, because a plugin built for the newer server may not run correctly on the older one. Make an inventory of every installed plugin with its version, note whether it was installed by hand or through the marketplace, and check each one against the target server version. Plan for the possibility that a plugin must be removed, replaced or rebuilt. Test each plugin in staging with real workflows, including any integrations that depend on it, before you return the environment to users.

Is there a password hashing issue to know about when rolling back?

Yes, and it is the trap most teams miss. Mattermost v11 changed password hashing, so accounts created or updated after the upgrade can carry hashes that an older server may not verify. Before you downgrade, confirm how your version handles password hashing and what your users will experience if they sign in to the older server. Test a login for a password set after the upgrade in staging. The details are specific to the versions involved, so verify them against the Mattermost upgrade and downgrade documentation for your exact path before you plan a rollback window.

Can our own team carry out the rollback, or do we need a partner?

Your team can carry out a rollback if it has Linux, PostgreSQL and Mattermost administration skills, a tested backup, a staging copy and a written procedure. A partner is useful when the team lacks that experience, when the deployment is a high availability cluster, or when a rollback must happen inside a tight window. DeployOpen plans, implements, backs up, upgrades and supports self-hosted open-source platforms in your infrastructure, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts. Ask any provider to define what they will do, what you must provide and what happens if the rehearsal fails.

How DeployOpen scopes and delivers a Mattermost rollback

DeployOpen plans and delivers Mattermost downgrades and rollbacks inside infrastructure you control, starting from a written scope and a tested recovery path. Each engagement covers the backup set, schema check, binary and plugin state, and the verification that proves the server is healthy before users return.

How we scope

  • Confirm the current server version, the target version and the upgrade path that was attempted before any change is made
  • Inventory the database, file storage, configuration, plugins and proxy settings that a rollback must restore together
  • Agree in writing whether the work is a fixed-scope recovery, a staging rehearsal, or both, with deliverables and timelines set before work starts

How we build

  • Build and rehearse the downgrade in a staging copy using mattermost db version --all to confirm the schema state before and after
  • Test plugin compatibility against the older server version and document which plugins must be reinstalled or disabled
  • Run the password hashing and login checks for the affected version so users can sign in after the rollback completes

How we hand over

  • Provide a runbook with the backup steps, schema checks, downgrade commands and the order in which services are stopped and started
  • Document the restore points, evidence of each verification step and the known limits of the rollback for your environment
  • Walk your operations team through the procedure so they can repeat it during a future maintenance window

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the rollback is complete
  • Retest the upgrade plan against the next monthly or Extended Support Release before your team attempts it again
  • Review backup and restore procedures on a recurring basis so the rollback path stays current with your environment

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.