Database Managment - Mongo DB

Back to Course

Lesson Description

Lession - #1431 MongoDB Create Backup

MongoDB - Create Backup

Dump MongoDB Data To make backup of information base in MongoDB, you ought to utilize mongodump order. This order will dump the whole information of your server into the landfill index. There are numerous choices accessible by which you can restrict how much information or make reinforcement of your far off server.
Syntax The basic syntax of mongodump command is as follows −


Example Begin your mongod server. Accepting that your mongod server is running on the localhost and port 27017, open an order fast and go to the canister registry of your mongodb occasion and type the order mongodump
Consider the mycol collection has the following data.


The order will associate with the server running at and port 27017 and back all information of the server to registry/container/dump/. Following is the result of the order

Restore data

To restore backup information MongoDB's mongorestore order is utilized. This order reestablishes every one of the information from the reinforcement registry.
Syntax The basic syntax of mongorestore command is


Following is the output of the command

dockerhub mongodb

dockerhub mongodb