This is a Node.js script to reformat Mattermost export data into Slack JSON format. This script supports Direct Messages, Group Messages, Public Channels, and Private Channels. See Limitations section for what is not supported.
- Node Version Manager (NVM) or Node v20 installed.
- Familiarity with Command Line
The general process is as follows:
- Generate Mattermost export using Mattermost bulk export tool
- Copy emojis from Mattermost server.
- Process Mattermost data and generate export folder
- Upload Emojis to Slack Admin (using a bulk import browser add-on is handy!)
- Zip the export folder and import to Slack
- On the Mattermost server, generate your export using the Mattermost command line tool:
mmctl export create --no-attachments - Once this is complete, copy the zip from the server and extract the contents.
- Move the
import.jsonlinto the root of this project.
- Copy the contents of your
emojidirectory found in the Mattermost uploads directory on the server into this project at/emoji
- Copy
.env.sampleto.envand update values as necessary
- Ensure your node version:
nvm installornvm use - Run the following:
npm run build - An export directory with the timestamp will be created in the
exportdirectory - Zip this directory (i.e.
export-{timestamp}) and proceed with data import using the Slack UI (see documentation)
*Note: In addition to the export-{timestamp} directory, channel-admins-{timestamp}.json and data-map--{timestamp}.json are created for reference only. These files are not needed during the Slack Import.
If you are intending to filter data before/after a certain date, you can pass a unix timestamp:
npm run build -- after=1715294431037- Direct upload of Zip to Slack failed even though file size was under 2GB
- Slack upload tool instructs that Google Drive can be linked, but documentation says it cannot. Ultimately uploading Zip to Dropbox and linking is what worked for us.
- This script does not import file attachments / file uploads from Mattermost
- Reactions to top-level messages – this seemed to be a bug with the Mattermost export leaving this data out as opposed to this script actually handling it.