Uncategorized

MongoDb import export using container

Pinterest LinkedIn Tumblr

Dump expo
1)sudo docker exec -i master-management_mongodb /usr/bin/mongodump –username user –password password –authenticationDatabase admin –db mms2 –out /dump
2) sudo docker cp master-management_mongodb:/dump ~/Downloads/
Restore:
sudo docker cp ~/Downloads/dump/mms2 master-management_mongodb:/dump
sudo docker exec -it master-management_mongodb bash
sudo docker exec -i master-management_mongodb /usr/bin/mongorestore –username user –password password –authenticationDatabase admin –db mms3 /dump/