This commit is contained in:
2026-05-13 19:58:16 +03:00
commit f5adeb292b
78 changed files with 12024 additions and 0 deletions

67
README.md Normal file
View File

@@ -0,0 +1,67 @@
# loop-etl-rocketchat
An ETL framework to migrate data from RocketChat to Loop. This utility exports data from a source RocketChat database and generates a Loop import file.
## Install
1. Install [Node.js](https://nodejs.org/en/) Version [6.11.0 LTS](https://nodejs.org/en/download/) or greater
2. Clone this repo
`$ git clone https://git.wilix.dev/loop/loop-etl-rocketchat`
3. Install dependencies
`$ cd loop-etl-rocketchat`
`$ npm install`
4. Run tests
`$ npm test`
## Export RocketChat
Export supports the following entities:
1. Users and roles. Only global roles are supported
2. Custom emoji. File storage: FileSystem and GridFS
3. Channels
4. Direct channels
5. RocketChat Discussions (subchannels) are partially supported, see below
7. User uploads. File storage: FileSystem and GridFS
8. Posts with per user flag. Channel pins are not supported by import specification.
9. Replies and Reactions
## RocketChat exporting
1. Copy the example config file to config.js
```
cp context/config.example.rocketchat.js context/config.js
```
2. Prepare your source and target configuration
1. Set `source.uploadsPath` for file uploads (user avatars and file uploads)
2. Set `source.customEmojiPath` for custom emojies
3. Set `target.filesPath` for Loop output directory
3. If you have LDAP enabled, Community version of Loop 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`. Set `ldap_auth_service` to map ldap to a Loop login service.
If it's GitLab, configure `gitlab` with `host` and `token` registered in Gitlab with User access.
It is used for id mapping, without it Loop won't import the users and throw an error.
Before migrating to Loop, ensure you have Gitlab integration enabled in Loop and all users are present in Gitlab.
4. If you used RocketChat discussions, they will migrate in separate channels with random names.
You can merge discussions in parent channel with `mergeDiscussionIntoParent`
5. Global channel in Rocket Chat is **General** and in Loop - **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.
6. Run migrate script with `npm run start:rocketchat`
7. Configure Loop (DB and Gitlab integration) before running the migration
8. Run the migration in Loop
## Import
1. Run the Loop import command as explained in the [documentation](https://loop.yonote.ru/share/750208a7-e016-4319-8c7e-fb08a91f51f6)
---
Based on [mattermost-etl](https://github.com/Brightscout/mattermost-etl) and [mattermost-etl-rocketchat](https://github.com/lexbritvin/mattermost-etl-rocketchat), both licensed under MIT.