How to Backup and Restore MongoDB database

In this article, we will see the steps to Backup and Restore MongoDB database. It is important to take regular backups of our system. Backups are good protection against most types of failures.

mongodump tool is used to take backup of MongoDB database or collection or subset of collection.
mongorestore tool is used to restore database or collection on the target database.

mongodump Syntax:

mongodump [options]

Few options are:

–authenticationDatabase
–db
–username
–password
–out
–host
–uri
–collection
–query
–archive
–oplog
–dumpDbUsersAndRoles
–excludeCollection

MongoDB backup examples:

Continue reading How to Backup and Restore MongoDB database