mongodump usage for MongoDB backup and restore

According to MongoDB Backup manual, mongodump is a very handy tools for MongoDB administrator to backup and restore full mongodb cluster or single database or single collection.

mongodump usage

Here is a very simple command to take backup or restore mongodb system.


sudo mongodump --host hostName -d databaseName --port portNumber --username userName --password passWord --out directoryLocation

with the above command you can take backup of your database. I don’t need to explain all parameters as I wrote variable name very clearly.


 sudo mongorestore --host hostName -d databaseName --port portNumber --username userName --password passWord backupSourceLocation 

I guess it will help you quickly.

Shaharia is a professional software engineer with more than 10 years of experience in the relevant fields. Digital ad certified, cloud platform architect, Big data enthusiasts, tech early adopters.

Site Footer