Created
February 3, 2022 13:37
-
-
Save NitnekB/ae5f46242c5e39e25f2d925e41cfe46b to your computer and use it in GitHub Desktop.
Mongo backup & restore
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
| # Use this command to get a backup | |
| mongodump -u <USER> -p <PASSWORD> --port=<PORT> --authenticationDatabase admin -d <DATABASE> -c <COLLECTION> | |
| # Use this command to restore back up (removing the old one) | |
| mongorestore --db <DATABASE> ./<COLLECTION>.bson --drop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment