Created
September 10, 2021 21:53
-
-
Save fortunto2/680b1526bfd7e5229312a4e2bc8a91fe to your computer and use it in GitHub Desktop.
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
mongodump --host localhost --port 27017 --username root --password XXXX --authenticationDatabase admin -d XXXX --gzip --archive > dump_`date "+%Y-%m-%d"`.gz | |
mongorestore --archive="mongodump-test-db" --nsFrom='test.*' --nsTo='examples.*' | |
#### build mongo dumper | |
git clone https://github.com/mongodb/mongo-tools | |
cd mongo-tools | |
sudo apt-get install -y libkrb5-dev | |
./make build -tools=mongodump,mongorestore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment