Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
docker container id - 8c37a950839a
# 1. Copy Mongo dump to container folder
(Local System)$ docker cp dump/reaction 8c37a950839a:/var/backups/reaction
# 2. Connect to mongodb docker container
(Local System)$ docker exec -it 8c37a950839a /bin/bash
# 3. Check if backup is copied to docker container
(Container)$ ls var/backups/reaction
# 4. Drop Database
(Container)$ mongo
(Container->Mongo)$ show dbs -> use reaction -> db.dropDatabase() -> exit
# 5. Restore dump inside container to Mongodb from the container shell
(Container)$ mongorestore -d reaction var/backups/db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.