3

I use this docker image : https://hub.docker.com/_/rocket.chat/

So here is the code i used :

docker run --name db -d mongo:3.0 --smallfiles
docker run --name rocketchat --link db -d rocket.chat

I tried several things, but I can't find a way to have a clean backup/restore system.

Any advice ?

bob dylan
  • 989
  • 2
  • 10
  • 26
  • can you elaborate your question a bit more by what you mean by backup/restore? – Tarun Lalwani Jun 27 '18 at 19:07
  • With a traditionnal `docker commit / save / load / run` my Rocket is ending up empty like a fresh install. Does rocket have a special way to backup inside docker ? Should I backup only the mongo db ? – bob dylan Jun 28 '18 at 09:41
  • Looking at https://github.com/RocketChat/Docker.Official.Image/blob/9c795567e4aa75922085df5f7469650a5c9f9c86/Dockerfile you should map the volume for `/app/uploads` because that will not be committed with the image, you also need to the same with mongodb. Folders marked as volume will not be saved/committed with an image – Tarun Lalwani Jun 28 '18 at 09:44

1 Answers1

5

For the posterity : Backing up Rocket.chat on SERVER 1 and Restore it on SERVER 2, based on the official docker image :

SERVER 1

cd /backups
docker run -it --rm --link db -v /backups:/backups mongo:3.0 mongodump -h db -o /backups/mongoBACKUP
tar czf mongoBACKUP.tar.gz mongoBACKUP/

Then send mongoBACKUP.tar.gz on SERVER 2 in /backups.

SERVER 2 (+ test on :3000)

docker run --name db -d mongo:3.0 --smallfiles
cd /backups
tar xzf mongoBACKUP.tar.gz
docker run -it --rm --name mongorestore -v /backups/mongoBACKUP:/var/dump --link db:db mongo mongorestore --host db /var/dump
docker run -p 3000:3000 --name rocket --env ROOT_URL=http://yourwebsite.test --expose 3000 --link db -d rocket.chat
Community
  • 1
  • 1
bob dylan
  • 989
  • 2
  • 10
  • 26