Created
October 18, 2023 10:21
-
-
Save shansana/77721d64d95aebe34ecbc4de02a5805a to your computer and use it in GitHub Desktop.
Mongo DB dump and restore database using srv/uri (Example Atlas)
This file contains hidden or 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
# Replace URI, your_db_name and C:\somelocation with your values | |
mongodump --uri mongodb+srv://dbuser:[email protected] --authenticationDatabase admin --db your_db_name -o "C:\somelocation\your_db_name" | |
mongorestore --uri mongodb+srv://dbuser:[email protected] --authenticationDatabase admin --db your_restore_db_name "C:\somelocation\your_db_name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment