Created
June 11, 2021 14:59
-
-
Save zeppelinen/bab5bd75f7f341f687209e7f0b4de74a to your computer and use it in GitHub Desktop.
Pipe output from mongodump to mongorestore
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 | |
mongodump --host HOST:PORT --db SOURCE_DB --username USERNAME --password PASSWORD --archive \ | |
| mongorestore --host HOST:PORT --nsFrom 'SOURCE_DB.*' --nsTo 'TARGET_DB.*' --username USERNAME --password PASSWORD --archive --drop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment