Last active
January 6, 2022 14:15
-
-
Save devtin/9ab5b5bc63d6f2cd4163998d55578564 to your computer and use it in GitHub Desktop.
mongoDb collection backup
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
#!/usr/bin/env bash | |
SRC_URI=<source-connection-uri> | |
SRC_DB=<source-database-name> | |
DST_URI=<destination-connection-uri> | |
DST_DB=<destination-database-name> | |
FLOW=1000 | |
mongodump --archive --uri $SRC_URI --db $SRC_DB | mongorestore --archive --uri $DST_URI --db $DST_DB --numInsertionWorkersPerCollection=$FLOW |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment