How to backup mongodb on a meteor app deployed with MUPX

て烟熏妆下的殇ゞ 提交于 2019-12-23 16:15:04

问题


I've deployed my Meteor app with MUPX with mongodb on the server.

MUPX puts mongodb in a docker container.

How do I back it up?

I ran the command docker exec -it mongodb mongodump

and it looked like it did a dump. but when I type ls I don't see any files. I think it dumped the files inside the docker container.

How can I access the dump files on my server? And then transfer them to my local computer?


回答1:


I figured it out. I had to learn more about how to use docker.

So first after running the command docker exec -it mongodb mongodump

The dump was inside the docker container.

To see running docker container type

docker ps

Check out the files in the container with name mongodb by using command

docker exec -it mongodb ls

You will see the dump directory. To copy it over to outside the container, to your server use

docker cp mongodb:dump .

that will copy the dump directory into your current directory. Then just use scp to copy from to your local computer



来源:https://stackoverflow.com/questions/32793352/how-to-backup-mongodb-on-a-meteor-app-deployed-with-mupx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!