Backup database from snap and restore on manual installation

I want to get rid of snap.
I have RocketChat 0.69.0 installed via snap on Ubuntu 17.10.
I did backup of database with this manual

Now I have this backup file on my CentOS with new RocketChat.
How I can restore this database?

I have this manual, but I need more arguments for
mongorestore ~/backup
it does not work this way:

[root@localhost tsuser]# ls
backup  backup.tgz
[root@localhost tsuser]# mongorestore backup
2018-09-07T12:37:20.803+0300    preparing collections to restore from
2018-09-07T12:37:20.804+0300    don't know what to do with subdirectory "var/snap", skipping...
2018-09-07T12:37:20.804+0300    done
mongorestore --host localhost --port 27017 -d rocketchat
2018-09-07T16:16:01.504+0300    the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead
2018-09-07T16:16:01.504+0300    using default 'dump' directory
2018-09-07T16:16:01.504+0300    see mongorestore --help for usage information
2018-09-07T16:16:01.504+0300    Failed: mongorestore target 'dump' invalid: stat dump: no such file or directory

I need more arguments! :slight_smile:

Check contents of your backup folder. Sounds like it put full path inside the archive.

Probably something like: mongorestore --db rocketchat bacup/var/snap/rocketchat-server/common/dump/parties

Walk the folder tree and set the above path to where the .json files are sitting

1 Like

@aaron.ogle
thanks for help
I’m almost made it
https://paste.ubuntu.com/p/5HyfFsNx6p/
need more arguments :slight_smile:

You skipped providing the DB name you want to import as.

As above --db rocketchat /path/to/dump

1 Like

@aaron.ogle, thanks a lot!
it’s works for me
mongorestore --db rocketchat backup/var/snap/rocketchat-server/1321/dump/parties/
Now I have my rocketchat back, but when I choose open channel I have error that “channel is not found”


Can I fix this problem some how?

Ok, I fix it!
The problem channel now called “general”, so I rename it to old name and now it’s work!
Thank a lot.

1 Like