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