Skip to content

Instantly share code, notes, and snippets.

@tidalgo22
Created July 13, 2018 04:24
Show Gist options
  • Save tidalgo22/250e43415fcd8a36d483a3ce91889c10 to your computer and use it in GitHub Desktop.
Save tidalgo22/250e43415fcd8a36d483a3ce91889c10 to your computer and use it in GitHub Desktop.
mongorestore on existing running container
Docker exec -it <mongo_container_name> /bin/bash
on shell access:
- mongo
- show dbs
- use db_sample
- db.dropDatabase()
- show dbs :check if db_sample has been deleted
exit mongo and run mongorestore
- mongorestore --db <new_database_name> ./db_sample
./db_sample - is the path of the folder containing the dump database
ref
https://www.youtube.com/watch?v=CHNB38MAvKY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment