An ETL framework to migrate data from Jabber to Mattermost. This utility exports data from a source Jabber database and generates a Mattermost Bulk Loading import file. Eventually, we'll enhance this project to support migrations from other messaging sources.
-
Install Node.js Version 6.11.0 LTS or greater
-
Clone this repo
$ git clone https://github.com/Brightscout/mattermost-etl
-
Install dependencies
$ cd mattermost-etl
$ npm install
-
Run tests
$ npm test
-
Copy the example config file to config.js
$ cp context/config.example.js context/config.js
-
Modify the values in
context/config.js
for the source, target, and team properties.
-
Execute the ETL exporter
$ npm start
-
Inspect the output file,
data.json
, or whatever you set as the target filename. Ensure the results are as expected.
Export supports the following entities:
- Users and roles. Only global roles are supported
- Custom emoji. File storage: FileSystem and GridFS
- Channels
- Direct channels
- RocketChat Discussions (subchannels) are partially supported, see below
- User uploads. File storage: FileSystem and GridFS
- Posts with per user flag. Channel pins are not supported by import specification.
- Replies and Reactions
-
Copy the example config file to config.js
cp context/config.example.rocketchat.js context/config.js
-
Prepare your source and target configuration
- Set
source.uploadsPath
for file uploads (user avatars and file uploads) - Set
source.customEmojiPath
for custom emojies - Set
target.filesPath
for MM output directory
- Set
-
If you have LDAP enabled, Community version of Mattermost doesn't support LDAP. If you have Community version, consider configuring ldap mapping to gitlab or disable it to use default login.
Specify it in
config.js
. Setldap_auth_service
to map ldap to a MM login service. If it's GitLab, configuregitlab
withhost
andtoken
registered in Gitlab with User access. It is used for id mapping, without it MM won't import the users and throw an error.
Before migrating to MM, ensure you have Gitlab integration enabled in MM and all users are present in Gitlab. -
If you used RocketChat discussions, they will migrate in separate channels with random names. You can merge discussions in parent channel with
mergeDiscussionIntoParent
-
Global channel in Rocket Chat us General and in Mattermost - Town Square. To have only 1 global channel, the configuration provides default example in
channels.map
. You can specify migration for other channels as well. -
Run migrate script with
npm run start:rocketchat
-
Configure Mattermost (DB and Gitlab integration) before running the migration
-
Run the migration in MM
- Run the Mattermost bulk loading command as explained here
Made with ♥ by Brightscout