How to create backup of all collections of MongoDB

Following commands will create backup of your mongoDB collections

mongodump --username=MYUSERNAME --db=MYDB --password=DBPASSWORD --host=IP_OR_HOST:27017 --authenticationDatabase=admin

MYUSERNAME – Replace this text with the username of your mongodb MYDB – Replace with Database Name DBPASSWORD – Replace with your Database password IP_OR_HOST – Just enter IP address or server URL of server where mongodb installed, If you are taking backup on same server then you can just mention localhost in place of IP_OR_HOST

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.