Script to migrate Rocket.Chat databases to Matrix Synapse
Go to file
2023-05-20 10:41:41 +02:00
src Add CI, mdl and pre-commit 2023-05-20 10:41:41 +02:00
.editorconfig Set up TS, linter and formatter 2023-05-19 17:16:13 +02:00
.eslintrc.yaml Set up TS, linter and formatter 2023-05-19 17:16:13 +02:00
.gitignore Add whoami example 2023-05-19 17:48:31 +02:00
.markdown-style.rb Add CI, mdl and pre-commit 2023-05-20 10:41:41 +02:00
.mdlrc Add CI, mdl and pre-commit 2023-05-20 10:41:41 +02:00
.pre-commit-config.yaml Add CI, mdl and pre-commit 2023-05-20 10:41:41 +02:00
.prettierrc.yaml Set up TS, linter and formatter 2023-05-19 17:16:13 +02:00
.woodpecker.yml Add CI, mdl and pre-commit 2023-05-20 10:41:41 +02:00
docker-compose.yml INIT 2023-05-17 18:45:48 +02:00
draft.drawio INIT 2023-05-17 18:45:48 +02:00
package-lock.json Add whoami example 2023-05-19 17:48:31 +02:00
package.json Add whoami example 2023-05-19 17:48:31 +02:00
README.md Add whoami example 2023-05-19 17:48:31 +02:00
tsconfig.json Add whoami example 2023-05-19 17:48:31 +02:00

Rocket.Chat to Matrix Migration Script

Drafts and more

Exporting RC data

Currently manually via mongodb. Run the following on the server:

mongoexport --collection=rocketchat_message --db=rocketchat --out=rocketchat_message.json
mongoexport --collection=rocketchat_room --db=rocketchat --out=rocketchat_room.json
mongoexport --collection=users --db=rocketchat --out=users.json

Running the Matrix Dev Server

docker-compose run --rm -e SYNAPSE_SERVER_NAME=my.matrix.host -e SYNAPSE_REPORT_STATS=no synapse generate
docker-compose up -d
# Register a admin user
docker-compose exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml --admin --user verdiadmin --password verdiadmin

Then you can access the homeserver in Element Web or the local admin interface as http://localhost:8008 with the verdiadmin as username AND password.

You can store an access token for that user:

curl --request POST \
  --url http://localhost:8008/_matrix/client/v3/login \
  --header 'Content-Type: application/json' \
  --data '{"type": "m.login.password","user": "verdiadmin","password": "verdiadmin","device_id": "DEV"}' \
> src/config/synapse_access_token.json

Design Decisions

  • Getting data from Rocket.Chat via (currently) manual mongodb export
  • Room to Channel conversion:
    • Read-only attributes of 2 verdigado channels not converted to power levels due to complexity