Backup and Restore Database in MongoDB

Level : Advanced
Mentor: Shailendra Chauhan
Duration : 00:01:00

What is Data Backup?

MongoDB's mongodump tool is used for data backups. It just dumps all data into MongoDB's dump directory. Backed-up data is stored in BSON format, also known as BSON data dump. By default, the backup is placed in MongoDB's bin\dump folder. To provide a different output path, use the -out option.

Understanding mongodump Usage: With or Without Arguments

Without Argument

Without any input from the user, mongodump connects to a MongoDB instance on the local system via port 27017 and generates backups of all databases and collections.

With argument

Specifying the database in the argument allows us to limit the amount of data stored in the database dump.

What is Data Restoration?

MongoDB uses the mongorestore utility to restore backup data. It recovers the binary backup made by the mongodump software (which creates BSON data dumps). It can restore the complete database backup or a section of it. It also restores any indexes made for any collection within that database. Mongorestore searches for database backups in mongodb's bin\dump folder, which is also where the mongodump command dumps backups.

Self-paced Membership
  • 24+ Video Courses
  • 825+ Hands-On Labs
  • 400+ Quick Notes
  • 125+ Skill Tests
  • 10+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this