Created
July 13, 2018 04:24
-
-
Save tidalgo22/250e43415fcd8a36d483a3ce91889c10 to your computer and use it in GitHub Desktop.
mongorestore on existing running container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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