Migrate Mattermost from MySQL to PostgreSQL

A planned move off MySQL, which Mattermost no longer supports, using the documented migration-assist tool or a manual pgloader process, tested on a copy before cutover. Plugin data for Boards, Playbooks and Calls needs its own check.

On this page

Why moving Mattermost from MySQL to PostgreSQL is a planned migration project

If your self-hosted Mattermost still runs on MySQL, you need a planned database migration to PostgreSQL, because MySQL support ended with v11.0 and you cannot stay on it through upgrades. The work is a project, not a configuration change: it touches every row of your message history, your plugin data and the production cutover window, so the effort depends on what you have stored and how much downtime your users will tolerate. Mattermost documents two routes, an automated path with the migration-assist tool and a manual path, and both require pgloader to be installed separately on the machine that runs them.

Three factors set the size of the job. The first is data volume, since the migration rewrites your full database and the Mattermost documentation recommends sizing the PostgreSQL server to start at the same size as the MySQL server. The second is plugin data: the Mattermost guide covers migrating data for Boards, Playbooks and Calls, so inventory which of these plugins are enabled and how much data they hold before you estimate. The third is the cutover window, which is the period when Mattermost is stopped or read-only while the final data moves. Ask your Mattermost administrator and database team to confirm current message volume, attachment storage location and plugin usage, and check whether your version needs upgrading to v8.x or later first, as the documentation recommends.

Run a full rehearsal on a copy of the MySQL database before any production change. The documentation recommends running migration-assist on a separate server with 2 CPU cores and 16 GB RAM, which keeps the load off your production instance. Use the rehearsal to measure real run time, check row counts and plugin data after the move, confirm the Mattermost server starts cleanly against PostgreSQL, and time the cutover steps. The rehearsal result, not an estimate, should set your maintenance window and your rollback plan.

What maps cleanly from MySQL to PostgreSQL and what needs review

This table compares each part of a MySQL-hosted Mattermost installation with its PostgreSQL target and marks what usually moves without change and what needs a check in your own environment. Read the right-hand column as your review list before the trial run, not as a guarantee that every item is safe. The main takeaway is that the database content moves through the tooling, while file storage, plugin data, custom database objects and server version still need your confirmation.

AreaOn MySQL todayOn PostgreSQL target and what to review
Server version prerequisiteMattermost server must be at v8.x or later before the move, per the documented pathConfirm the running version and upgrade first if older. Support for MySQL ended with v11.0, so the source database is already outside supported versions.
Core tables and messagesPosts, channels, teams and reactions stored in MySQL tablesMoved by the migration tooling. Compare row counts per major table on the copy before cutover and record the results.
Users and channel membershipUser accounts, roles and channel membership in MySQLVerify sign-in for a sample of accounts after the trial run, including accounts linked to SSO or AD/LDAP.
Files on shared storageAttachments stored on local disk or a shared store, referenced by path or keyThe database move does not copy files. Confirm the file store location and that the target server reads the same files.
Plugin data for Boards, Playbooks and CallsPlugin tables and data created by these plugins in the MySQL databaseMattermost documents plugin data migration for these three plugins. Confirm each one is installed and test its content after the move.
Custom database objectsAny views, triggers, stored procedures or custom tables added by your team or integrationsNot covered by the standard path. Inventory them first, since MySQL-specific syntax will not run unchanged on PostgreSQL.
Database hostingSelf-managed MySQL or a managed MySQL serviceConfirm whether the target is self-managed PostgreSQL or AWS RDS, since the documented guide states support for RDS.
Sizing of the migration hostSource database size and current server resourcesThe tool is recommended to run on a separate server with 2 CPU cores and 16 GB RAM. The PostgreSQL server should initially match the MySQL server's size.

Documented migration paths: migration-assist, manual pgloader and the tools around them

Mattermost documents two routes for moving a MySQL database to PostgreSQL: an automated run with the migration-assist tool and a manual process built on pgloader. The cards below cover each route, the tools each one depends on and the checks that decide which route fits your environment.

Automated route with migration-assist

Migration-assist is Mattermost's automated path from MySQL to PostgreSQL. Mattermost recommends running it on a separate server against a copy of the MySQL database, not the live source, so a failed run never touches production. Confirm that the tool's version matches the Mattermost server version you are moving to, and that your MySQL data is current enough to test against. Use the migration guide to confirm the steps and prerequisites for your server version.

Migration guide

Manual route with pgloader

The manual path uses pgloader, which Mattermost requires you to install separately. It loads data from the MySQL source into PostgreSQL and gives your DBA direct control over type mapping, load order and error handling. Choose this route when your team needs to inspect or adjust each step, or when the automated run fails on your data. Confirm the pgloader version you install against the version notes in the migration guide before you start.

Migration guide

Mattermost server and mmctl

The Mattermost server binary and its command line tool, mmctl, are needed on both the source and target sides. Run the same server version against the copy used for testing and against the target database, so schema and configuration match what the migration expects. Use mmctl to check that the server starts, that the target database is reachable and that users, teams and channels appear after the move. Confirm the exact version pairing in the upgrade notes before you schedule the cutover.

Upgrade notes

PostgreSQL client and server tools

The psql client, the PostgreSQL server packages and the pg_dump and pg_restore utilities are the tools your team uses to create the target database, verify row counts and take a backup before the load. Size the target server to start at least as large as the MySQL server, as Mattermost recommends. Confirm that the PostgreSQL major version you choose is still in support for the life of the deployment, not just at cutover.

PostgreSQL versioning policy

Backups and point-in-time recovery

A tested backup is the rollback plan for this migration. Take a full MySQL backup before the copy, and keep a PostgreSQL base backup and archived write-ahead logs for the target once it goes live. Continuous archiving supports point-in-time recovery, which lets you return the target to a moment before a bad load. Confirm the restore procedure on a separate host before the cutover window, since an untested backup offers no rollback.

Continuous archiving docs

Connection pooling and access checks

Mattermost opens many database connections, and a pooler such as PgBouncer can reduce the number of direct connections the PostgreSQL server must hold during and after the move. Check the Mattermost database settings and the PostgreSQL authentication method before cutover, so the server can connect with the account and method your security policy allows. Confirm with your DBA whether a pooler belongs in this deployment and test its behavior with the Mattermost workload.

PgBouncer project

How the MySQL to PostgreSQL move runs from inventory through cutover

This sequence takes a Mattermost database from MySQL to PostgreSQL in an order that proves the migration on a copy before any production data moves, so the cutover is a planned event rather than a first attempt.

  1. Confirm the server version and upgrade first

    Record the Mattermost server version currently running and check it against the upgrade notes. Mattermost recommends upgrading to v8.x or later before migrating, and support for MySQL ended with v11.0, so a server that is already on a supported release still needs a database move. Your team or DeployOpen runs the upgrade in a test environment first, then in production. The step is done when the application runs on v8.x or later and the team has confirmed the target version for the rest of the work.

  2. Inventory data, plugins and integrations

    List the MySQL schema size, attachment storage location, custom plugins, and the plugin data held in the database for Boards, Playbooks and Calls. Note every external connection that uses the database, such as reporting tools, backup jobs and monitoring. Confirm with the owners of each integration which ones must be repointed after cutover. The step is done when you have a written inventory that the migration plan references, including the plugins whose data needs its own migration process as described in the Mattermost guide.

  3. Provision the PostgreSQL target

    Build the PostgreSQL server in infrastructure you control. Mattermost advises that the PostgreSQL server should initially match the MySQL server's size, so start from the sizing of the existing database host and adjust after measuring load. Confirm the PostgreSQL major version with your database team against the supported release list, and check whether your environment uses AWS RDS, which the Mattermost guide says the process supports. The step is done when the target accepts connections from the Mattermost application nodes and a backup of the empty target has been restored successfully.

  4. Install the migration tools on a separate server

    Prepare a separate server for the migration work, not the production Mattermost host. Mattermost suggests 2 CPU cores and 16 GB RAM for migration-assist. Install pgloader separately, since Mattermost requires it to be installed on its own, and install the migration-assist tool that matches your server version. The step is done when both tools run and report their versions, and the separate server can reach both a copy of the MySQL database and the PostgreSQL target.

  5. Run migration-assist against a copy of MySQL

    Take a fresh dump of the MySQL database and restore it to a copy that the migration server can read, leaving production untouched. Run migration-assist against that copy and direct its output to the PostgreSQL target, or follow the manual pgloader process if your team prefers to control each step. Capture the full run log, including any errors and the time the run took. The step is done when the run completes without unresolved errors and the log is saved with the migration record.

  6. Validate the test run and the application

    Point a non-production Mattermost instance at the migrated PostgreSQL database and test sign-in, channel and message history, file references, search, and the plugin data for Boards, Playbooks and Calls. Compare row counts for key tables between MySQL and PostgreSQL and check that counts and sample records match. Record every defect and retest after each fix. The step is done when the test instance passes the agreed checklist and the team signs off the cutover runbook.

  7. Plan and execute the production cutover

    Schedule a maintenance window, stop writes to Mattermost, take a verified backup of the MySQL database and the file store, then run the migration against the final data. Repeat the validation checks on production data, repoint Mattermost and the dependent integrations to PostgreSQL, and bring the service back. Keep the MySQL database and its backup in place for rollback. The step is done when users can sign in, post and open files, and the backups are confirmed restorable.

  8. Decommission MySQL after a verified period

    After the team agrees that the production system has run correctly on PostgreSQL for an observation period set in your change policy, remove MySQL from the Mattermost configuration and retire the server. Keep a final archived backup according to your retention rules. Update the runbooks, monitoring and backup jobs so they no longer reference MySQL. The step is done when MySQL no longer serves any Mattermost traffic, the final backup is stored and catalogued, and the decommission record is signed off.

Why the test run on a copy of the database decides the cutover date

The rehearsal on a copy of the MySQL database decides the cutover date, because it is the only place you learn how long the conversion takes and what breaks before production users depend on the result. Mattermost recommends running migration-assist on a separate server against a copy of the MySQL database, not on the live server. Keep that separate host in the plan from the start: it needs its own copy of the data, a PostgreSQL target that initially matches the size of the MySQL server, and pgloader installed separately, as the migration guide requires. The tool itself is documented to run comfortably on 2 CPU cores and 16 GB RAM, so confirm that the host you choose meets that suggestion and has enough disk for the copy plus the converted output.

Each rehearsal should prove more than that the command finished. Compare row counts for users, channels, posts and file info between MySQL and PostgreSQL, and confirm that every attachment path referenced in the database resolves to a file in your file store. Log in as a sample of real accounts through your actual identity provider, and check that plugin data for Boards, Playbooks and Calls arrived and that those plugins load and work. Then run normal application tasks such as posting, searching, file upload and a call. Record the elapsed time of each step, since that figure, measured on your own volumes rather than an estimate, is what sets the downtime window.

Confirm several things with Mattermost before you commit to a date: the exact migration-assist version you will run, how your deployment's plugin data is handled for each plugin you use, and whether your environment (including any AWS RDS database) follows the documented path. Plan a second rehearsal if the first one surfaces failed rows or missing attachments, and treat a clean rehearsal with documented timings as the input to the cutover window, not the schedule you wish for.

How Boards, Playbooks and Calls data are handled during the move

Boards is the Mattermost plugin for kanban-style boards, cards and their associated properties. Mattermost's MySQL to PostgreSQL guide covers a plugin data migration for Boards, so the board structure and card content are expected to move with the rest of the database. Confirm the exact steps in the guide for your server version rather than assuming the default flow covers every board property you use.

  • Board and card records: Check that a sample of boards, their cards and their columns open with the same titles, order and assignees as before the move.
  • Attachments and images: Confirm that card attachments still resolve, because file references depend on the file store configuration as well as the database.
  • Permissions and membership: Verify that private and team boards keep their visibility settings and that members see the same boards they did on MySQL.
  • Plugin version match: Record the Boards plugin version on the source and target so you can explain any differences in behavior after the move.

After the move, sample boards from several teams and compare them against the source copy, including one board with attachments and one private board.

What drives the cost and duration of a MySQL to PostgreSQL move

This table lists the factors that change how long a move off MySQL takes and how much of the work falls on your team or a partner. Read each row as a question to answer about your own deployment before asking for a quote. The main takeaway is that database size, plugin data, custom SQL and high availability usually set the effort more than the migration tool itself.

DriverWhy it changes effortHow to keep it under control
Database size and message historyMigration-assist runs against a copy of the MySQL database on a separate server, and the tool suggests 2 CPU cores and 16 GB RAM. Larger histories lengthen the conversion, the validation and the cutover window.Confirm the row counts and database size with a query before scoping. Decide whether older history is still needed in the target.
Plugin data for Boards, Playbooks and CallsMattermost's guide covers plugin data migration for these three plugins. Each one you run adds tables to verify and test after the move.List installed plugins and their data volumes early. Remove unused plugins only after confirming nothing depends on their data.
Custom integrations and direct SQL accessScripts, reporting jobs or BI tools that query MySQL directly must be found, rewritten for PostgreSQL syntax and retested. Hidden dependencies are the most common source of unplanned work.Inventory every connection string, service account and scheduled query that touches the database before the first test run.
High availability (Enterprise or Enterprise Advanced)High availability is an Enterprise or Enterprise Advanced feature. Clustered deployments need the migration and cutover planned across redundant application and database servers, plus read replicas if you use them.Confirm your plan level and topology before scoping. Ask whether the quote covers each application node and replica.
Storage layoutClusters need shared file storage on S3, an S3-compatible service or NAS mounted on each node. Local disk on a cluster is not supported, so storage problems can surface during testing.Confirm where attachments live and whether they stay in place. Verify storage access from every node during a trial run.
Downtime windowA shorter allowed outage usually means more rehearsal, tighter cutover scripting and more parallel checks. A longer window allows simpler sequencing but may not suit your users.Agree the acceptable window in writing and run at least one full rehearsal against a copy before choosing the cutover method.
Number of environmentsEach environment (test, staging, production, disaster recovery) needs its own migration run, configuration review and verification. Repeating the process is a large share of the effort.Ask whether the quote covers all environments or only production, and whether the test runs are included.
Internal skillsTeams that already operate PostgreSQL, pgloader and Mattermost administration need less guidance. Gaps in these skills add time for review, troubleshooting and handover.Assess who will run the database after go-live. Ask for documented runbooks and knowledge transfer in the scope.
Database operation after go-live (recurring)After cutover, PostgreSQL needs its own backups, point-in-time recovery, minor and major upgrades, monitoring and connection management. This work repeats for the life of the deployment.Decide who owns these tasks, whether they are staffed internally or under a retainer, and what the quote excludes.

What usually goes wrong in a MySQL to PostgreSQL move and how to prevent it

Most failed database moves trace back to a few predictable gaps: the source version, the server sizing, the data scope and the rehearsal. The cards below cover each risk with the check that prevents it, so the migration runs against a verified copy and the rollback path stays intact.

Skipping the upgrade to v8.x

Mattermost recommends upgrading to v8.x or later before moving the database, so the migration starts from a version the tooling expects. Running the move on an older server adds a second variable to troubleshoot during cutover. Confirm the current server version and the upgrade notes for each step before you schedule the migration window.

Upgrade notes

Running migration-assist against production

Mattermost recommends running migration-assist on a separate server against a copy of the MySQL database. Running it against the live database risks load on production users and changes to data that you cannot cleanly reconcile. Build the copy, run the tool there, and keep production read-only only for the final cutover window.

Undersizing the PostgreSQL server

Mattermost says the PostgreSQL server should initially match the MySQL server's size, and the tool itself needs capacity on its own host. A smaller target slows the import, the indexes and the first queries after go-live. Ask your DBA to confirm storage headroom for the converted data, indexes and write-ahead logs before you commit to an instance size.

Tool host guidance
2 cores, 16 GB

Missing plugin data for Boards, Playbooks and Calls

Boards, Playbooks and Calls keep data that a basic table copy can miss, and a migration that only covers core tables leaves those features empty. Mattermost's guide covers plugin data migration for these three plugins. List every installed plugin, confirm which ones hold data, and verify each one in the rehearsal before cutover.

Migration guide

Broken file paths after the move

A database move does not relocate attachments, and a file store that points at the wrong path or mount breaks message history even when every row migrates. Record the file store configuration before migration, confirm that the target server reads the same storage, and open a sample of old attachments from the migrated copy. Do not change the storage driver during this move.

Rollback paths that depend on MySQL

MySQL support ended with v11.0, so a rollback that restores a MySQL database onto a current server may not be a supported path. Decide before cutover how you will return to service if the PostgreSQL target fails, and confirm with Mattermost which server versions can run against each database. Keep the MySQL source intact and read-only until the rollback decision is closed.

Cutover without a restore-tested backup

A backup that has never been restored is not evidence that recovery works. Before cutover, restore a full backup of the PostgreSQL target and of the MySQL source into a separate environment, start Mattermost against each, and check users, channels, posts and attachments. Record the restore time so the outage plan rests on a measured number.

Questions buyers ask before moving Mattermost off MySQL

What does moving Mattermost off MySQL cost, and what drives it?

The cost is mostly labor and infrastructure, and the largest driver is how much data you hold and how many systems depend on the database. You pay for the people who plan the cutover, run the migration tool against a copy, validate the result and support the new PostgreSQL server afterward. Infrastructure is a second component: Mattermost recommends running migration-assist on a separate server with 2 CPU cores and 16 GB RAM, and says the PostgreSQL server should initially match the size of the MySQL server. Ask any partner for a quote that lists those servers, the number of test runs, the plugin data in scope, and the post-cutover support period as separate line items. Mattermost's own license terms do not change because of the database move, but any paid plan you hold is a separate cost to confirm with Mattermost.

How long does a MySQL to PostgreSQL migration take?

Duration depends on the effort involved, not a fixed number, and the sources supplied for this topic do not give a timeline. The main effort drivers are the Mattermost version you start from (Mattermost recommends upgrading to v8.x or later first), the database size, the number of plugins with data to move, and how many trial runs your team needs before it trusts the result. Teams with a current version, a clean database and no custom plugin data usually spend less time on validation than teams that must upgrade first. Ask for a written schedule that separates the upgrade, the trial runs, the cutover window and the rollback plan, and confirm the expected effort for each with your own environment in view.

What does the internal team need to provide for this migration?

Your team needs to supply access, knowledge of the current environment and decision rights, while the migration work itself can be done by you or a partner. Expect to provide access to the MySQL server and the Mattermost configuration, a separate server for migration-assist or pgloader, a PostgreSQL server sized to match the current database, and a named owner for user acceptance testing. Someone must also know which integrations, bots and plugins are in use, because those affect what must be checked after the move. Your database and infrastructure engineers should be ready to review backups, network rules and storage paths, and your change board must approve the cutover window.

Can our own team do this migration without a partner?

Yes, a capable internal team can follow the documented process, but the decision depends on skills and time rather than on whether the tool exists. The documented route has two paths: an automated migration with the migration-assist tool, or a manual path where pgloader must be installed separately. Your team needs to be comfortable with MySQL and PostgreSQL administration, Mattermost server upgrades, and verification of data after a load. If those skills or the time to run several trial runs are not available, a fixed-scope engagement with a written list of deliverables can cover the planning, the trial runs and the cutover support. Compare both options against the same written scope before deciding.

Does moving Mattermost to PostgreSQL require downtime?

Yes, you should plan for a maintenance window, and the length of that window depends on your data and your rehearsal results. The migration needs the application stopped while the final data is moved so that no writes are lost, so the downtime is set by how long the final copy and checks take on your database. Run the process against a copy first to measure that time on your own data. Confirm with the Mattermost migration guidance which steps must happen with the server stopped, and agree on the window with the people who depend on the service. Do not promise a zero-downtime cutover unless the documented procedure for your version supports it.

How are Boards, Playbooks and Calls plugin data handled during the move?

Mattermost's MySQL to PostgreSQL guide covers plugin data migrations for Boards, Playbooks and Calls, so these plugins are in scope for the documented process. Check which of these plugins you run and whether they hold data you need to keep, because each one adds validation work. Confirm that the plugin versions are compatible with the target Mattermost version, and test that boards, playbook runs and call records open correctly on the copy before the cutover. Also check any custom plugins, which the documented path does not cover, and plan their data separately.

What is the rollback plan if the PostgreSQL cutover fails?

A rollback plan keeps the original MySQL database and a verified backup until the new system has passed acceptance testing. Before the cutover, take a full backup of the MySQL database and the file storage, record the Mattermost version and configuration, and write down the exact steps to point the application back to MySQL. Decide in advance who has authority to call a rollback and how long you will wait before making that call. Test the rollback on the copy as well, because a plan that has never been run is an assumption. Ask any partner to show how rollback is handled in the written scope and what it would cost if it were needed.

How the parallel copy, test run and cutover fit together

The rehearsal starts from a copy of the production MySQL database, never from production itself. The copy is moved to a separate server where migration-assist or a manual pgloader process writes into a PostgreSQL target sized to match the MySQL server at first. Before any cutover decision, the team validates the PostgreSQL result, including the plugin data for Boards, Playbooks and Calls. Production MySQL stays in place and held for rollback until the new database is accepted and the old one is decommissioned.

Rehearsal copy, migration run, validation and cutover, with MySQL kept for rollback.

Running PostgreSQL after the move: versions, authentication and recovery

Once Mattermost runs on PostgreSQL, the database becomes an operational component with its own version lifecycle, and the first decision is which major version to run. The supported versions in the facts are 18 (final release November 14, 2030), 17 (to November 8, 2029), 16 (to November 9, 2028), 15 (to November 11, 2027) and 14 (to November 12, 2026). Versions 13 and earlier are unsupported. Pick a major version deliberately by checking it against Mattermost's supported database list for your server release, then record its end date in your patch calendar. Minor releases never change the storage format, so applying them means replacing the executables and restarting PostgreSQL, which is a routine maintenance window. Major upgrades are a separate project. Confirm with your DBA whether you will use dump and restore, pg_upgrade or logical replication, and plan that project before the version reaches end of life.

Assign an owner for three operational controls before go-live. The first is client authentication, which is configured in pg_hba.conf. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so confirm that the Mattermost database role uses SCRAM and that certificate or other methods are chosen deliberately for database connections. The second is replication. Hot standbys can serve read-only queries, and you must decide between synchronous replication, where commits wait for standbys, and asynchronous replication. Mattermost read replicas are a separate feature that also requires the database to be set up accordingly, so confirm the requirements with Mattermost before you build them. The third is recovery. PostgreSQL does not detect a failed primary or promote a standby on its own, so automatic failover needs external tooling and tested runbooks. Also evaluate PgBouncer as a connection pooling layer, and test it against Mattermost before adopting it, because pooling modes affect session behavior.

How DeployOpen works on this

DeployOpen scopes the MySQL to PostgreSQL move in writing, rehearses it against a copy of your database, and hands over the cutover runbook and evidence your team needs to run it. Engagements are fixed-scope, so the scope, deliverables and timeline are agreed before work starts.

How we scope

  • We confirm your current Mattermost version and whether it must be upgraded to v8.x or later before migration.
  • We size the separate migration server and the initial PostgreSQL server against your existing MySQL server.
  • We record which plugin data for Boards, Playbooks and Calls is in scope, and how each will be checked.

How we build

  • We install pgloader separately and run migration-assist on a copy of the MySQL database, never on production.
  • We run the manual path where the automated tool does not fit your data, documenting each step and its output.
  • We rehearse the full cutover, including configuration changes and restarts, and record timings and any failures found.

How we hand over

  • You receive a written cutover runbook with rollback steps, validation queries and sign-off points for your team.
  • You receive a rehearsal report listing the tests run, the results, and the open issues to resolve before go-live.
  • We walk your administrators through the PostgreSQL configuration, backup settings and the post-migration checks.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the migration is complete.
  • Post-cutover support can cover monitoring of the new database and planning for later Mattermost upgrades.
  • Support scope, response expectations and fees are set in the written agreement, and we will quote them from your scope.

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.