# Backup from Docker, Restore to Snap?

**URL:** <https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307>\
**Category:** Community Support\
**Created:** [August 3, 2019, 10:58pm UTC](https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307 "2019-08-03T22:58:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0ahn](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@m0ahn](https://forums.rocket.chat/u/m0ahn)\
**Post date:** [August 3, 2019, 10:58pm UTC](https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307/1 "2019-08-03T22:58:18Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [August 5, 2019, 3:30pm UTC](https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307/2 "2019-08-05T15:30:40Z")

</div>

> 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’)

> <https://github.com/RocketChat/Rocket.Chat/issues/14165>
>
> \*\*Description:\*\*
> Trying to migrate the server from old(2 gb / 1 cpu) to new(4 g…b / 2 cpu). But unable to migrate data using mongodump and mongorestore as mentioned on #4297 . Also, tried using the \_snap run rocketchat-server.backupdb\_ at https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/#snaps
> 
> \*\*Steps to reproduce:\*\*
> \- On the old server: mongodump ~/backup
> \- Archive the dir: tar czf mongodump.tar.gz backup
> \- Upload the tar to new server
> \- Install the rocketchat and all components without rocketchat not running
> \- Extract the dump: tar xzf mongodump.tar.gz
> \- Restore the dump: mongorestore backup
> \- Start the rocketchat server
> \- Access the site
> 
> \*\*Actual behavior:\*\*
> Starts the setup screen from the beginning with no data from old backup
> 
> \*\*Server Setup Information:\*\*
> Version of Rocket.Chat Server: 0.74.3
> Operating System: Ubuntu server 18.04 LTS
> Deployment Method: \[Manual tar installation\](https://rocket.chat/docs/installation/manual-installation/ubuntu/)
> Number of Running Instances: 1
> NodeJS Version: 8.11.3
> MongoDB Version: 3.6.12

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.

---

<div class="post-metadata">

**Author:** ![m0ahn](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@m0ahn](https://forums.rocket.chat/u/m0ahn)\
**Post date:** [August 11, 2019, 11:16am UTC](https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307/3 "2019-08-11T11:16:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [August 11, 2019, 11:52am UTC](https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307/4 "2019-08-11T11:52:30Z")

</div>

Pi - even more fun.

Ask Pi related issues at [https://open.rocket.chat/channel/raspberrypi](https://open.rocket.chat/channel/raspberrypi)

---

<div class="post-metadata">

**Author:** ![surendrababu.s](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@surendrababu.s](https://forums.rocket.chat/u/surendrababu.s)\
**Post date:** [August 2, 2020, 2:42pm UTC](https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307/5 "2020-08-02T14:42:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hafija](https://avatars.discourse-cdn.com/v4/letter/h/46a35a/32.png) [@hafija](https://forums.rocket.chat/u/hafija)\
**Post date:** [April 29, 2021, 7:34am UTC](https://forums.rocket.chat/t/backup-from-docker-restore-to-snap/4307/6 "2021-04-29T07:34:29Z")

</div>

How can check mongo db version and db name?
