{"id":49650911,"url":"https://github.com/verdigado/rocketchat2matrix","last_synced_at":"2026-05-06T04:33:12.361Z","repository":{"id":207349853,"uuid":"719027643","full_name":"verdigado/rocketchat2matrix","owner":"verdigado","description":"Script to migrate Rocket.Chat databases to Matrix Synapse. Mirror of https://git.verdigado.com/NB-Public/rocketchat2matrix","archived":false,"fork":false,"pushed_at":"2024-04-22T08:32:52.000Z","size":647,"stargazers_count":9,"open_issues_count":11,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-22T09:47:04.429Z","etag":null,"topics":["matrix","migration","rocketchat","synapse"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/verdigado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-15T09:47:41.000Z","updated_at":"2024-04-23T12:32:32.836Z","dependencies_parsed_at":"2024-04-23T12:32:21.087Z","dependency_job_id":null,"html_url":"https://github.com/verdigado/rocketchat2matrix","commit_stats":null,"previous_names":["verdigado/rocketchat2matrix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/verdigado/rocketchat2matrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verdigado%2Frocketchat2matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verdigado%2Frocketchat2matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verdigado%2Frocketchat2matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verdigado%2Frocketchat2matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verdigado","download_url":"https://codeload.github.com/verdigado/rocketchat2matrix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verdigado%2Frocketchat2matrix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32678628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matrix","migration","rocketchat","synapse"],"created_at":"2026-05-06T04:33:11.153Z","updated_at":"2026-05-06T04:33:12.334Z","avatar_url":"https://github.com/verdigado.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rocket.Chat to Matrix Migration Script\n\nScript to migrate users, channels and messages from Rocket.Chat communication platform to a Matrix Synapse server.\nIt currently has beta quality and comes with no warranty.\n\n## Installation and Usage\n\nThis setup is intended to migrate from Rocket.Chat to Synapse once, using mongo database dumps and a fresh Synapse instance. After the migration and some clean up, the Synapse might be used by users.\n\n### Exporting RC data\n\nCurrently manually via mongodb. Run the following on the server:\n\n```shell\nmongoexport --collection=rocketchat_message --db=rocketchat --out=rocketchat_message.json\nmongoexport --collection=rocketchat_room --db=rocketchat --out=rocketchat_room.json\nmongoexport --collection=users --db=rocketchat --out=users.json\n```\n\nExport them to `inputs/`\n\n### Configuring the Matrix Dev Server\n\nGenerate a Synapse homeserver config with the following command (you might change `my.matrix.host` for the actual server name, as it can't be changed afterwards):\n\n```shell\ndocker compose run --rm -e SYNAPSE_SERVER_NAME=my.matrix.host -e SYNAPSE_REPORT_STATS=no synapse generate\n```\n\nTo run the script without hitting rate limiting and activating an _Application Service_ to send messages by different users with our desired timestamps, you MUST add the following options to the freshly generated `files/homeserver.yaml`. **Do not leave these in the production setup!**\n\n```yaml\nrc_joins:\n  local:\n    per_second: 1024\n    burst_count: 2048\nrc_joins_per_room:\n  per_second: 1024\n  burst_count: 2048\nrc_message:\n  per_second: 1024\n  burst_count: 2048\nrc_invites:\n  per_room:\n    per_second: 1024\n    burst_count: 2048\n  per_user:\n    per_second: 1024\n    burst_count: 2048\n  per_issuer:\n    per_second: 1024\n    burst_count: 2048\napp_service_config_files:\n  - /data/app-service.yaml\n```\n\nNow edit `app-service.example.yaml` and save it at `files/app-service.yaml`, changing the tokens manually.\n\nCopy over `.env.example` to `.env` and insert your values. Also export the variables with `source .env`.\n\n### Starting the Matrix Dev Server\n\nBoot up the container and (for the first time starting the server or after resetting it manually) create an admin user:\n\n```shell\ndocker compose up -d\n# Wait for the Server to boot, then register an admin user\ndocker compose exec -it synapse register_new_matrix_user http://localhost:8008 --config /data/homeserver.yaml --admin --user $ADMIN_USERNAME --password $ADMIN_PASSWORD\n```\n\nThen you can access the homeserver in [Element Web](https://app.element.io/#/login) or the [local admin interface](http://localhost:8080) as `http://localhost:8008` with your `$ADMIN_USERNAME`/`$ADMIN_PASSWORD` as username/password.\n\nStore an access token for that user:\n\n```shell\ncurl --request POST \\\n  --url http://localhost:8008/_matrix/client/v3/login \\\n  --header 'Content-Type: application/json' \\\n  --data \"{\\\"type\\\": \\\"m.login.password\\\",\\\"user\\\": \\\"$ADMIN_USERNAME\\\",\\\"password\\\": \\\"$ADMIN_PASSWORD\\\",\\\"device_id\\\": \\\"DEV\\\"}\" \\\n\u003e src/config/synapse_access_token.json\n```\n\n### Installing and Running the Script\n\nInstall NodeJS \u003e= v19 and npm on your system, install the script's dependencies via `npm install --omit=optional`.\n\nTo finally run the script, execute it via `npm start`.\n\n### Running Tests\n\n`npm test`.\n\n### Cleaning Up\n\nTo clean up the Synapse server and local storage database, run either the convenience script `./reset.sh` or start with:\n\n```shell\ndocker compose down\nsudo rm files/homeserver.db\nrm db.sqlite\n```\n\nThen you can restart with an empty but quite equal server, following the instructions above to start the dev server.\n\n## Design Decisions\n\n- Getting data from Rocket.Chat via manual mongodb export\n- Room to Channel conversion:\n  - Read-only attributes of channels not converted to power levels due to complexity\n- Reactions and emojis:\n  - So far only reactions used in our chats have been translated\n  - To add more, `src/emojis.json` can be modified (PRs with additions are appreciated)\n    - These mappings take precedence over the used translation library\n  - Individual logos of _netzbegruenung_ and _verdigado_ have been replaced by a generic sunflower\n  - Skin colour tones and genders have been ignored in the manual translation, using the neutral versions\n- Discussions are not translated, yet, as they have a channel-like data structure which probably should be translated to threads\n- Generally state change events are not translated (anymore, for the sake of complexity), but the final state should be equal\n  - Memberships: change events are ignored. Memberships are applied at the start, when needed or terminated at the end\n  - Name changes: as the previous state is usually unknown, they are ignored\n- If the root message of a thread is deleted or of a deleted user, the thread will be skipped\n- The script follows a design to easily continue a migration if the script crashed by restarting it\n- Any normal username containing the configured admin name causes trouble\n\n## Contributing\n\nThis FOSS project is open for contributions. Just open an issue or a pull request.\n\n### Hint: pre-commit\n\nTo keep the code clean and properly formatted, install and use [`pre-commit`](https://pre-commit.com/).\n\n- Install it via `pip install pre-commit`\n- Install the repo's pre-commit hooks for yourself: `pre-commit install`.\n\n  Now it will run whenever you commit something\n\n- Run pre-commit against all files: `pre-commit run --all-files`\n\n## License\n\nLicensed under AGPL v3 or newer.\nCopyright 2023 verdigado eG \u003csupport@verdigado.com\u003e.\n\n## Support\n\nContact \u003csupport@verdigado.com\u003e to get an offer for personal or commercial support. Community support might be provided through the issue tracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverdigado%2Frocketchat2matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverdigado%2Frocketchat2matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverdigado%2Frocketchat2matrix/lists"}