Last active
May 15, 2024 18:28
-
-
Save lucakiebel/22da32d89278328bcbc0bc9610281223 to your computer and use it in GitHub Desktop.
Use Mongodump and Mongorestore to backup and restore MongoDB Databases run in docker-compose
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
docker-compose exec -T mongodb mongodump --authenticationDatabase admin -u root -p password --db test --archive --gzip > dump.gz |
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
docker-compose exec -T mongodb mongorestore --authenticationDatabase admin -u root -p password --archive --gzip < dump.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment