Database Reference
In-Depth Information
Using import and export tools
In order to import or export binary data from and into the database, developers can use
tools in this group. We use tools and utilities in this category to create or restore backups
for our MongoDB server. In further chapters, we will discuss the backup strategies in de-
tail.
The following are the tools that are available to perform these kinds of tasks:
•
mongodump
•
mongorestore
•
bsondump
•
mongooplog
Understanding mongodump
This process comes in handy when developers or system administrators want to create a
dump file from a database in the binary format. This utility and other related tools are use-
ful for MongoDB backup strategies.
The
mongodump
process is able to retrieve data from either
mongod
or
mongos
pro-
cesses.
Note
For more information on mongodump, visit the MongoDB documentation page at
ht-
Utilizing mongorestore
This process is used to restore and write the binary files that are generated by the
mon-
godump
process into the database server. To restore data,
mongorestore
can establish a
new database or use an existing database. Just like the
mongodump
instance,
mon-
gorestore
can connect to a
mongos
instance or it can connect directly to the
mongod
process.
Note