2019-04-04 13:16:02 +02:00
|
|
|
# Import from Mattermost
|
|
|
|
|
|
|
|
Starting with Zulip 2.1, Zulip supports importing data from Mattermost,
|
|
|
|
including users, channels, messages, and custom emoji.
|
|
|
|
|
|
|
|
|
|
|
|
**Note:** You can only import a Mattermost team as a new Zulip
|
|
|
|
organization. In particular, you cannot use this tool to import data
|
|
|
|
into an existing Zulip organization.
|
|
|
|
|
|
|
|
## Import from Mattermost
|
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
First, export your data from Mattermost.
|
|
|
|
The instructions below correspond to various common ways Mattermost is installed; if
|
2020-05-05 15:52:32 +02:00
|
|
|
yours isn't covered, [contact us](/help/contact-support) and we'll help you out.
|
2019-04-17 01:07:18 +02:00
|
|
|
|
|
|
|
Replace `<username>` and `<server_ip>` with the appropriate values below.
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-10 14:27:43 +02:00
|
|
|
{start_tabs}
|
|
|
|
|
|
|
|
{tab|mm-default}
|
|
|
|
|
|
|
|
1. SSH into your Mattermost production server.
|
|
|
|
|
|
|
|
```
|
2019-04-17 01:07:18 +02:00
|
|
|
ssh <username>@<server_ip>
|
2019-04-10 14:27:43 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
2. Navigate to the directory which contains the Mattermost executable.
|
|
|
|
On a default install of Mattermost, the directory is `/opt/mattermost/bin`.
|
|
|
|
|
|
|
|
```
|
|
|
|
cd /opt/mattermost/bin
|
|
|
|
```
|
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
3. Create an export of all your Mattermost teams, as a tar file.
|
2019-04-10 14:27:43 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
sudo ./mattermost export bulk export.json --all-teams
|
|
|
|
mkdir -p exported_emoji
|
|
|
|
tar --transform 's|^|mattermost/|' -czf export.tar.gz \
|
|
|
|
exported_emoji/ export.json
|
|
|
|
```
|
|
|
|
|
2019-04-14 05:33:07 +02:00
|
|
|
4. Exit your shell on the Mattermost server.
|
2019-04-10 14:27:43 +02:00
|
|
|
|
|
|
|
`exit`
|
|
|
|
|
2019-04-14 05:33:07 +02:00
|
|
|
5. Finally, copy the exported tar file from the server to your local
|
|
|
|
computer. You may need to replace `/opt/mattermost/bin/` with the
|
|
|
|
path to your Mattermost installation.
|
2019-04-10 14:27:43 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
scp <username>@<server_ip>:/opt/mattermost/bin/export.tar.gz .
|
|
|
|
```
|
|
|
|
|
|
|
|
{tab|mm-docker}
|
|
|
|
|
2019-04-14 05:33:07 +02:00
|
|
|
1. SSH into the server hosting your Mattermost docker container.
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-09 10:56:12 +02:00
|
|
|
```
|
2019-04-17 01:07:18 +02:00
|
|
|
ssh <username>@<server_ip>
|
2019-04-09 10:56:12 +02:00
|
|
|
```
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-09 10:56:12 +02:00
|
|
|
2. Navigate to the the Mattermost docker directory. On most installs the
|
|
|
|
directory should be `mattermost-docker`.
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-09 10:56:12 +02:00
|
|
|
```
|
|
|
|
cd mattermost-docker/
|
|
|
|
```
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
3. Create an export of all your Mattermost teams, as a tar file.
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-09 10:56:12 +02:00
|
|
|
```
|
|
|
|
docker exec -it mattermost-docker_app_1 mattermost \
|
|
|
|
export bulk data/export.json --all-teams
|
|
|
|
cd volumes/app/mattermost/data/
|
|
|
|
mkdir -p exported_emoji
|
|
|
|
tar --transform 's|^|mattermost/|' -czf export.tar.gz \
|
|
|
|
exported_emoji/ export.json
|
|
|
|
```
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-14 05:33:07 +02:00
|
|
|
4. Exit your shell on the Mattermost server.
|
2019-04-09 10:56:12 +02:00
|
|
|
|
|
|
|
`exit`
|
|
|
|
|
2019-04-14 05:33:07 +02:00
|
|
|
5. Finally, copy the exported tar file from the server to your local
|
|
|
|
computer. You may need to replace `mattermost-docker` with the
|
|
|
|
appropriate path for your installation.
|
2019-04-09 10:56:12 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
scp <username>@<server_ip>:mattermost-docker/volumes/app/mattermost/data/export.tar.gz .
|
|
|
|
```
|
2019-04-10 14:27:43 +02:00
|
|
|
|
2019-04-12 20:18:01 +02:00
|
|
|
{tab|mm-gitlab-omnibus}
|
|
|
|
|
|
|
|
1. SSH into your GitLab Omnibus server.
|
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
2. Create an export of all your Mattermost teams, as a tar file.
|
2019-04-12 20:18:01 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
cd /opt/gitlab/embedded/service/mattermost
|
|
|
|
sudo -u \
|
|
|
|
mattermost /opt/gitlab/embedded/bin/mattermost \
|
|
|
|
--config=/var/opt/gitlab/mattermost/config.json \
|
|
|
|
export bulk export.json --all-teams
|
|
|
|
mkdir -p exported_emoji
|
|
|
|
tar --transform 's|^|mattermost/|' -czf export.tar.gz \
|
|
|
|
exported_emoji/ export.json
|
|
|
|
```
|
|
|
|
|
2020-10-23 02:43:28 +02:00
|
|
|
3. Exit your shell on the GitLab Omnibus server.
|
2019-04-12 20:18:01 +02:00
|
|
|
|
|
|
|
`exit`
|
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
4. Finally, copy the exported tar file from GitLab Omnibus to your local computer.
|
2019-04-12 20:18:01 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
scp <username>@<server_ip>:/opt/gitlab/embedded/bin/mattermost/export.tar.gz .
|
|
|
|
```
|
2019-04-10 14:27:43 +02:00
|
|
|
{end_tabs}
|
|
|
|
|
2020-06-09 00:58:42 +02:00
|
|
|
### Import into Zulip Cloud
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2020-05-28 02:00:13 +02:00
|
|
|
Email support@zulip.com with your exported archive,
|
2019-04-17 01:07:18 +02:00
|
|
|
the name of the Mattermost team you want to import, and your desired Zulip
|
2019-04-04 13:16:02 +02:00
|
|
|
subdomain. Your imported organization will be hosted at
|
|
|
|
`<subdomain>.zulipchat.com`.
|
|
|
|
|
|
|
|
If you've already created a test organization at
|
|
|
|
`<subdomain>.zulipchat.com`, let us know, and we can rename the old
|
|
|
|
organization first.
|
|
|
|
|
|
|
|
### Import into a self-hosted Zulip server
|
|
|
|
|
|
|
|
First
|
|
|
|
[install a new Zulip server](https://zulip.readthedocs.io/en/stable/production/install.html),
|
|
|
|
skipping "Step 3: Create a Zulip organization, and log in" (you'll
|
|
|
|
create your Zulip organization via the data import tool instead).
|
|
|
|
|
|
|
|
Use [upgrade-zulip-from-git][upgrade-zulip-from-git] to
|
|
|
|
upgrade your Zulip server to the latest `master` branch.
|
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
Log in to a shell on your Zulip server as the `zulip` user. To import with
|
|
|
|
the most common configuration, run the following commands, replacing
|
|
|
|
`<team-name>` with the name of the Mattermost team you want to import.
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
```
|
2019-04-04 13:16:02 +02:00
|
|
|
cd /home/zulip
|
|
|
|
tar -xzvf export.tar.gz
|
|
|
|
cd /home/zulip/deployments/current
|
2020-05-12 22:23:17 +02:00
|
|
|
supervisorctl stop all # Stop the Zulip server
|
2019-04-04 13:16:02 +02:00
|
|
|
./manage.py convert_mattermost_data /home/zulip/mattermost --output /home/zulip/converted_mattermost_data
|
|
|
|
./manage.py import "" /home/zulip/converted_mattermost_data/<team-name>
|
2020-05-12 22:23:17 +02:00
|
|
|
./scripts/restart-server
|
2019-04-04 13:16:02 +02:00
|
|
|
```
|
|
|
|
|
2020-05-12 22:23:17 +02:00
|
|
|
This could take several minutes to run, depending on how much data
|
|
|
|
you're importing. The server stop/restart is only necessary when
|
|
|
|
importing on a server with minimal RAM, where an OOM kill might
|
|
|
|
otherwise occur.
|
2019-04-04 13:16:02 +02:00
|
|
|
|
|
|
|
**Import options**
|
|
|
|
|
|
|
|
The commands above create an imported organization on the root domain
|
|
|
|
(`EXTERNAL_HOST`) of the Zulip installation. You can also import into a
|
|
|
|
custom subdomain, e.g. if you already have an existing organization on the
|
|
|
|
root domain. Replace the last line above with the following, after replacing
|
|
|
|
`<subdomain>` with the desired subdomain.
|
|
|
|
|
|
|
|
```
|
|
|
|
./manage.py import <subdomain> /home/zulip/converted_mattermost_data/<team-name>
|
|
|
|
```
|
|
|
|
|
|
|
|
{!import-login.md!}
|
|
|
|
|
2019-10-14 21:40:48 +02:00
|
|
|
[upgrade-zulip-from-git]: https://zulip.readthedocs.io/en/latest/production/upgrade-or-modify.html#upgrading-from-a-git-repository
|
2019-04-04 13:16:02 +02:00
|
|
|
|
2019-04-17 01:07:18 +02:00
|
|
|
## Caveats
|
2019-04-04 13:16:02 +02:00
|
|
|
|
|
|
|
Mattermost's export tool is incomplete and does not support exporting
|
|
|
|
the following data:
|
|
|
|
|
|
|
|
* user avatars
|
|
|
|
* uploaded files and message attachments.
|
|
|
|
|
|
|
|
We expect to add support for importing these data from Mattermost once
|
|
|
|
Mattermost's export tool includes them.
|
|
|
|
|
2019-09-25 15:46:05 +02:00
|
|
|
Additionally, Mattermost's data exports do not associated private
|
|
|
|
messages with a specific Mattermost team. For that reason, the import
|
|
|
|
tool will only import private messages for data export archives
|
|
|
|
containing a single Mattermost team.
|
|
|
|
|
2019-10-14 21:40:48 +02:00
|
|
|
[upgrade-zulip-from-git]: https://zulip.readthedocs.io/en/latest/production/upgrade-or-modify.html#upgrading-from-a-git-repository
|