Using the mongodump process, I successfully copied messages and database content to a new installation of Rocket.Chat, but things like settings, layout, assets, etc, are absent and are set to the defaults. Is there a documented process for copying/moving this content for a complete transfer of Rocket.Chat to a new server? Thank you.
I deployed a fresh Rocket.Chat instance, did mongodump -o /backup to backup the database, tar cvf backup.tar /backup to compress it for transfer, tar xvf backup.tar to uncompress on the new host, then mongorestore /backup/backup to restore the database. I believe the database has transferred correctly eg messages, user logins, etc, but the Rocket.Chat settings/data are absent.
I don’t believe I’m doing it correctly, it also gives a similar error. Is there any documentation on transferring to a new server where I can start the process from scratch?
I’d suggest you start by giving some background on the previous install. I.e. the deployment method, server version, etc. Then follow that up with what you exactly did on that server and then how you completed your migration process.
Without these bits of information it won’t be possible for us to figure out the root cause of the issue. Even to give you steps for migration we’d need information of your previous (or the existing ‘from’) install.
I installed it fresh about a week ago using docker-compose, it’s on the latest version of Rocket.Chat and MongoDB 4.4.10.
I followed the linked instructions (How can I move rocket chat to other server? · Issue #4297 · RocketChat/Rocket.Chat · GitHub) and this resulted in a partial transfer with some elements not being applied to the new installation (a blank installation of Rocket.Chat using the same docker-compose file)
Hmm the comment is quite old. Please try the backup restore method Duda linked. You’ll find my comment on that particular thread - follow that to back up and then copy over the resultant dump to the new install.
After performing your restore instructions on a fresh install I got the following message 5060 document(s) restored successfully. 2006 document(s) failed to restore. As before, messages and accounts transferred, but Rocket.Chat settings did not.
I attempted the “With Docker Compose” section first, but I got this error: ERROR: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?
I see… Now I get this error :ERROR: No such service: rocket-chat_mongo_1 when running the docker-compose exec -T rocket-chat_mongo_1 sh -c 'mongodump --archive' > db.dump command in the directory with the Rocket.Chat docker-compose.yml.
I tried the container ID and ID listed with docker ps in place of rocket-chat_mongo_1 but resulted in the same error.
docker-compose exec -T mongo sh -c 'mongodump --archive' > db.dump
when you run: docker ps
it will show all the containers info.
But when you are using the docker-compose, you must reference the service not the docker name.
The docker name, while using docker-compose, will be a combination of the project name (in your case, rocket-chat) plus the service name, plus the instance number, all of them separated with underscore.
So you end up with the container name rocket-chat_mongo_1
this will probably work too: docker exec rocket-chat_mongo_1 sh -c 'mongodump --archive' > db.dump
I got this on my machine:
dudanogueira@duda-rocket:/tmp$ docker ps | grep mongo
f3495d774fcc mongo:4.4 “docker-entrypoint.s…” 8 days ago Up 2 hours 0.0.0.0:27017->27017/tcp, :::27017->27017/tcp rocketconnect_mongo_1
now, run this: docker exec rocketconnect_mongo_1 sh -c ‘mongodump --archive’ > db.dump
of course, you should replace the rocketconnect_mongo_1 with what you have as your mongo docker name
With docker exec rocket-chat_mongo_1 sh -c ‘mongodump --archive’ > db.dump I get --archive’: 1: ‘mongodump: not found. I haven’t done this before, so I don’t know what could be the issue.
Now that I have the file, the database can be restored onto a new instance of Rocket.Chat, correct?
I’m unsure of how to proceed with doing it if that is the case.