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 127.0.0.1 and port 27017 and back all information of the server to registry/container/dump/. Following is the result of the order
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