You want to move your Mattermost data from one Mattermost server to another, including files, but can’t back up your database and files directly.
Note: These instructions are for Mattermost v5.36.1 and higher. Please upgrade your Mattermost instance if you are running an older version.
Install Mattermost and create a single Mattermost user as admin. Go to the System Console and configure it as necessary for your application. Instructions for installing Mattermost Server are available in our documentation
There are installation instructions on
mmctl's Github page or you can use the version
mmctl is currently packaged with the server release as a Linux binary. If you followed our standard installation instructions it will be located at
/opt/mattermost/bin/mmctl on your new server.
You Will Need
- The URL of the Mattermost server you are exporting from. This will look like
- The username and password for an username authenticated system administrator user
mmctl auth login https://mattermost-source.example.com/
https://mattermost-source.example.com with the URL of your Mattermost server. You will be asked for a profile name and a username and password.
If you would like to use Access Tokens, because you are using SAML or OpenID authentication, generate one with system administrator rights and run this command:
mmctl auth login https://mattermost.example.com/ --name mmst_source --access-token <YOUR ACCESS TOKEN>
<YOUR ACCESS TOKEN> with the access token you generated.
Then, be sure to set this profile with this command:
mmctl auth set mmst_source
Run this command to start the bulk export job:
mmctl export create --attachments
Note Be sure to include the
--attachments flag to include file attachments in your export. If you have a large number of files you should remove it so that
This will export all users, teams, channels, and direct and group messages in the Mattermost Server.
Record the returned export job ID:
Export process job successfully created, ID: oademxrchpnpirj1yduhg8xm5c
mmctl export job list to monitor the status of the job you started:
mmctl export job list
When the job is done it will have
ID: oademxrchpnpirj1yduhg8xm5c Status: success Created: 2021-07-12 12:59:23 -0400 EDT Started: 2021-07-12 12:59:36 -0400 EDT
mmctl export list to show the export files available for download. Record the returned filename:
Then, download the export with this command:
mmctl export download i5xxc65nfinsxb4zjq4tbdh4he_export.zip
i5xxc65nfinsxb4zjq4tbdh4he_export.zip with the name of the export file.
Repeat step 1 but use the URL of your destination Mattermost server, e.g.
mmctl auth login https://mattermost2.example.com/
Then, be sure to set this authentication profile with this command:
mmctl auth set mmst_dest
mmst_dest to the profile name you chose for the destination server.
Run this command to upload the file:
mmctl import upload i5xxc65nfinsxb4zjq4tbdh4he_export.zip
i5xxc65nfinsxb4zjq4tbdh4he_export.zip with the name of your export file.
Upload session successfully created, ID: bu4nwie39bfrmdwz8wmefyyhzc Import file successfully uploaded, name: jfgpx1up4ffabf5ws8jfrcwpuh
mmctl import list available to show the imports available:
Run this command to start the import job:
mmctl import process
mmctl import job list to view the status of the import:
ID: k5nefu3zpj86by8rxi3xaxk3sr Status: success Created: 2021-07-12 14:33:31 -0400 EDT Started: 2021-07-12 14:33:44 -0400 EDT
When it say success the import is complete.
Go to these locations in the System Console to verify the data was imported correctly:
Then, switch to one of the teams and browse the channels to make sure everything was imported as expected.
While this seems like a lot of steps this is much faster and easier than it used to be. And because you’re using
mmctl it can work from any machine that has access to both Mattermost servers.
Since we’ll be deprecating the traditional CLI tool - RIP
/opt/mattermost/bin/mattermost - all Mattermost administrators should install
mmctl. Besides making exports easy, it also lets you create users, reset passwords, and manage teams and channels from the command line or in scripts. Once it’s installed, just type
mmctl help and it will give you all the available options.
If you’d like to migrate from Slack, we have the
mmetl tool to convert it into the Mattermost bulk export format, which can be uploaded following the steps 6-10 above. More information is available on Github and in our documentation.