4 / 4
Nov 2024

Hello,

I have restored an eGroupware backup vm vom August this year, because the current one got broken during a hypervisor crash (docker is not starting anymore).
I can successfully restore the groupware files and database but I have problems restoring the rocketchat database.

The original backup was created with this command:

docker exec -t rocketchat-mongo mongodump --db rocketchat --archive=- --gzip > /var/lib/egroupware/default/rocketchat/dump/dump_date "+%Y-%m-%d".gz

The restore with this command fails:

cat /var/lib/egroupware/default/rocketchat/dump/dump_2024-11-07.gz | docker exec -i rocketchat-mongo mongorestore --db rocketchat --archive --gzip
2024-11-15T16:37:27.732+0000 The --db and --collection flags are deprecated for this use-case; please use --nsInclude instead, i.e. with --nsInclude=${DATABASE}.${COLLECTION}
2024-11-15T16:37:27.733+0000 Failed: stream or file does not appear to be a mongodump archive
2024-11-15T16:37:27.733+0000 0 document(s) restored successfully. 0 document(s) failed to restore.
read unix @->/var/run/docker.sock: read: connection reset by peer

I understand that the db parameter has to be replaced by nsInclude seemingly because of a newer mongorestore-version:

cat /var/lib/egroupware/default/rocketchat/dump/dump_2024-11-07.gz | docker exec -i rocketchat-mongo mongorestore --nsInclude=rocketchat --archive --gzip
2024-11-15T16:34:37.931+0000 Failed: stream or file does not appear to be a mongodump archive
2024-11-15T16:34:37.931+0000 0 document(s) restored successfully. 0 document(s) failed to restore.
read unix @->/var/run/docker.sock: read: connection reset by peer

The gz-dump-file can not be unzipped with gunzip, I have tried on different systems and different unzip programs:
gunzip dump_2024-11-07.gz
gzip: dump_2024-11-07.gz: invalid compressed data–format violated

I do not understand why the backup dump-gz-file seems to be corrupted.

Is there a way to extract the rocketchat database from a system where docker is no longer starting?

Any help is appreciated.

Sincerely,

Friedemann

  • created

    Nov '24
  • last reply

    Nov '24
  • 3

    replies

  • 613

    views

  • 2

    users

  • 1

    like

You can access the MongoDB Volume directly and rsync it to the new machine (obviously without MongoDB running!).
Run on the old/crashed box:

ls /var/lib/docker/egroupware-rocketchat_mongo/_data
rsync -av --delete /var/lib/docker/egroupware-rocketchat_mongo/_data/ root@<new-box>:/var/lib/docker/egroupware-rocketchat_mongo/_data/

Ralf

Hi Ralf,

thanks for your answer.
So it is sufficient to do a ‘systemctl stop mongod’ before rsync’ing?

Friedemann

No, MongoDB from our Rocket.Chat is running in a container, so you have to either

systemctl stop docker

or

docker stop rocketchat_mongo

Ralf