Backup from Docker, Restore to Snap?

I am trying to backup an existing Rocket Chat database from Docker and restore it to a new installation in Snap.

On the Docker host machine i’ve run:

mongodump --host <ip_address> --forceTableScan --db rocketchat
tar -czvf mongobackup.tar.gz *

I’ve then moved the file to Snap host and run:

cp ~/mongobackup.tar.gz /var/snap/rocketchat-server/common/mongobackup.tar.gz
mv backup_file.tgz rocketchat_backup.tgz
snap run rocketchat-server.restoredb /var/snap/rocketchat-server/common/rocketchat_backup.tgz

I then get the error:

Please check that your backup file contains the backup data within the “parties” directory.

I think this is because the database names are different but not 100% sure. Also not sure whether this approach will work at all?

Help!

I think this is because the database names are different but not 100% sure.

Yes I believe it is.

Also not sure whether this approach will work at all?

It probably will if you take care.

See something like this (just search here or github for ‘parties’)

You MUST make sure you are backing up and restoring to identical versions.

Don’t try and backup from say 1.1.4 and restore to 1.0.4 or vice versa.

Personally if you have docker happy and running I’d stay as you are unless you have a real pressing need to use snaps. They are OK for basic stuff but don’t update very quickly if you want new stuff, and are not flexible if you want to increase your user base.

Thanks. I do need to get it running on a Pi and so will have to accept this.

In the end i restored only the messages table and repointed the _id fields to correctly link to new groups and users. This isn’t scalable but solved my use case - the base config and users were simple to recreate - i just needed the message history.

Pi - even more fun.

Ask Pi related issues at https://open.rocket.chat/channel/raspberrypi

could any one suggest me doc for backup and restore of rocket chat with docker compose

I have old version of rocket chat and mongo db now i want to upgrade to latest version so i moved folders of my data into new ec2 instance when i start compose up rocket chat is not taking the backup it throws some errors

±---------------------------------------------------------------------+
| |
| ERROR! SERVER STOPPED |
| |
| Your database migration failed: |
| Cannot read property ‘value’ of undefined |
| |
| Please make sure you are running the latest version and try again. |
| If the problem persists, please contact support. |
| |
| This Rocket.Chat version: 3.5.0 |
| Database locked at version: 193 |
| Database target version: 201 |
| |
| Commit: 72718532bc46585cc7875909de3f137df1427be6 |
| Date: Mon Jul 27 23:53:49 2020 -0300 |
| Branch: HEAD |
| Tag: 3.5.0 |
| |
±---------------------------------------------------------------------+

TypeError: Cannot read property ‘value’ of undefined
at updateFieldMap (server/startup/migrations/v194.js:10:15)
at Object.up (server/startup/migrations/v194.js:108:3)
at migrate (app/migrations/server/migrations.js:276:4)
at Object.Migrations._migrateTo (app/migrations/server/migrations.js:343:4)
at Object.Migrations.migrateTo (app/migrations/server/migrations.js:179:20)
at module (server/startup/migrations/xrun.js:6:13)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at Module.moduleLink [as link] (/app/bundle/programs/server/npm/node_modules/meteor/modules/node_modules/reify/lib/runtime/index.js:52:22)
at module (server/startup/migrations/index.js:1:4408)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at Module.moduleLink [as link] (/app/bundle/programs/server/npm/node_modules/meteor/modules/node_modules/reify/lib/runtime/index.js:52:22)
at module (server/main.js:1:201)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at require (packages/modules-runtime.js:258:21)
at /app/bundle/programs/server/app/app.js:185400:15
at /app/bundle/programs/server/boot.js:401:38
at Array.forEach ()
at /app/bundle/programs/server/boot.js:226:21
at /app/bundle/programs/server/boot.js:464:7
at Function.run (/app/bundle/programs/server/profile.js:280:14)
at /app/bundle/programs/server/boot.js:463:13

How can check mongo db version and db name?