docs/main/administration-guide/manage/bulk-export-tool.mdx
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
<PlanAvailability slug="all-commercial" />Moving data from one Mattermost instance into another begins with exporting data to a JSONL file using the bulk loading feature. This tool is useful if you have created a server for a proof of concept, have created another server for production use, and now want to retain the history from the proof of concept instance.
You can export the following data types:
Configuration for data types such as exporting specific areas of the server, exporting additional types of posts, file attachments, webhooks, and bot messages is not yet supported. Deleted objects are also not yet supported.
For requests to add additional attributes or objects to our exporter, please add a feature request on our feature idea forum.
</Note></TabItem> <TabItem value="use-cli" label="Use CLI"> <Note>
- Identify the name of the completed export file by running the mmctl export list command.
- Download the export file to your local machine by running the mmctl export download command.
From Mattermost v6.0, this command has been deprecated in favor of mmctl export commands as the supported way to export data out of Mattermost.
</Note>The export command runs in the CLI. It has permissions to access all information in the Mattermost database.
To run the export command:
Navigate to the directory where the Mattermost server is installed. On a default install of Mattermost, the directory is /opt/mattermost.
Run the following command to extract data from all teams on the server. Note that you can change the file name and specify an absolute or relative path to dictate where the file is exported:
sudo -u mattermost bin/mattermost export bulk file.json --all-teams
sudo -u mattermost bin/mattermost export bulk /home/user/bulk_data.json --all-teams
Retrieve your file from the location you specified.
All Mattermost bulk export data files will begin with a Version object as the first line of the file. This indicates the version of the Mattermost bulk import file format with which the exported data is compatible.
This object is a member of the User object.
<table width="100%" border="1" cellpadding="5px" style={{marginBottom: '20px'}}> <tr class="row-odd"> <th class="head">Field name</th> <th class="head">Type</th> <th class="head">Description</th> </tr> <tr class="row-odd"> <td valign="middle">desktop</td> <td valign="middle">string</td> <td>Preference for sending desktop notifications. Will be one of the following values: <kbd>"all"</kbd> - For all activity. <kbd>"mention"</kbd> - Only for mentions. <kbd>"none"</kbd> - Never.</td> </tr> <tr class="row-odd"> <td valign="middle">desktop_sound</td> <td valign="middle">string</td> <td>Preference for whether desktop notification sound is played. Will be one of the following values: <kbd>"true"</kbd> - Sound is played. <kbd>"false"</kbd> - Sound is not played.</td> </tr> <tr class="row-odd"> <td valign="middle">email</td> <td valign="middle">string</td> <td>Preference for email notifications. Will be one of the following values: <kbd>"true"</kbd> - Email notifications are sent immediately. <kbd>"false"</kbd> - Email notifications are not sent.</td> </tr> <tr class="row-odd"> <td valign="middle">mobile</td> <td valign="middle">string</td> <td>Preference for sending mobile push notifications. Will be one of the following values: <kbd>"all"</kbd> - For all activity. <kbd>"mention"</kbd> - Only for mentions. <kbd>"none"</kbd> - Never.</td> </tr> <tr class="row-odd"> <td valign="middle">mobile_push_status</td> <td valign="middle">string</td> <td>Preference for when push notifications are triggered. Will be one of the following values: <kbd>"online"</kbd> - When online, away or offline. <kbd>"away"</kbd> - When away or offline. <kbd>"offline"</kbd> - When offline.</td> </tr> <tr class="row-odd"> <td valign="middle">channel</td> <td valign="middle">string</td> <td>Preference for whether @all, @channel, and @here trigger mentions. Will be one of the following values: <kbd>"true"</kbd> - Mentions are triggered. <kbd>"false"</kbd> - Mentions are not triggered.</td> </tr> <tr class="row-odd"> <td valign="middle">comments</td> <td valign="middle">string</td> <td>Preference for reply mention notifications. Will be one of the following values: <kbd>"any"</kbd> - Trigger notifications on messages in reply threads that the user starts or participates in. <kbd>"root"</kbd> - Trigger notifications on messages in threads that the user starts. <kbd>"never"</kbd> - Do not trigger notifications on messages in reply threads unless the user is mentioned.</td> </tr> <tr class="row-odd"> <td valign="middle">mention_keys</td> <td valign="middle">string</td> <td>Preference for custom non-case sensitive words that trigger mentions. Words are separated by commas.</td> </tr> </table>This object is a member of the ChannelMembership object.
<table width="100%" border="1" cellpadding="5px" style={{marginBottom: '20px'}}> <tr class="row-odd"> <th class="head">Field name</th> <th class="head">Type</th> <th class="head">Description</th> </tr> <tr class="row-odd"> <td valign="middle">desktop</td> <td valign="middle">string</td> <td>Preference for sending desktop notifications. Will be one of the following values: <kbd>"default"</kbd> - Global default. <kbd>"all"</kbd> - For all activity. <kbd>"mention"</kbd> - Only for mentions. <kbd>"none"</kbd> - Never.</td> </tr> <tr class="row-odd"> <td valign="middle">mobile</td> <td valign="middle">string</td> <td>Preference for sending mobile notifications. Will be one of the following values: <kbd>"default"</kbd> - Global default. <kbd>"all"</kbd> - For all activity. <kbd>"mention"</kbd> - Only for mentions. <kbd>"none"</kbd> - Never.</td> </tr> <tr class="row-odd"> <td valign="middle">mark_unread</td> <td valign="middle">string</td> <td>Preference for marking channel as unread. Will be one of the following values: <kbd>"all"</kbd> - For all unread messages. <kbd>"mention"</kbd> - Only for mentions.</td> </tr> </table>This object is a member of the Post object.
<table width="100%" border="1" cellpadding="5px" style={{marginBottom: '20px'}}> <tr class="row-odd"> <th class="head">Field name</th> <th class="head">Type</th> <th class="head">Description</th> </tr> <tr class="row-odd"> <td valign="middle">user</td> <td valign="middle">string</td> <td>The username of the user for this reply.</td> </tr> <tr class="row-odd"> <td valign="middle">emoji_name</td> <td valign="middle">string</td> <td>The emoji of the reaction.</td> </tr> <tr class="row-odd"> <td valign="middle">create_at</td> <td valign="middle">int</td> <td>The timestamp for the reply, in milliseconds since the Unix epoch.</td> </tr> </table>