macOS Sierra and Go 1.6 Incompatibility
Users running on macOS Sierra require the 3.2.10 or newer version of mongodump.
mongodump can be a part of a backup strategy with
mongorestore for partial backups based on a query, syncing from production to staging or development environments, or changing the storage engine of a standalone. However, the use of
mongorestore as a backup strategy can be problematic for sharded clusters and replica sets.
mongodump excludes the content of the
local database in its output.
If the string passed to
--hostcontains a list of
mongodinstances, but does not include the replica set name as a prefix to the host string,
mongodumpreads from the
nearestnode by default. For example:
mongodump overwrites output files if they exist in the backup data folder. Before running the
mongodump command multiple times, either ensure that you no longer need the files in the output folder (the default is the
dump/ folder) or rename the folders or files.
mongodump against a MongoDB deployment that has access control enabled, you must have privileges that grant
find action for each database to back up. The built-in
backup role provides the required privileges to perform backup of any and all databases.
Changed in version 3.0.0:
mongodump removed the
--dbpath as well as related
--journal options. To use
mongodump, you must run
mongodump against a running
mongos instance as appropriate.
Increases the amount of internal reporting returned on standard output or in log files. Increase the verbosity with the
-vform by including the option multiple times, (e.g.
Runs mongodump in a quiet mode that attempts to limit the amount of output.
This option suppresses:
- output from database commands
- replication activity
- connection accepted events
- connection closed events
New in version 3.4.6.
Specify a resolvable URI connection string to connect to the MongoDB deployment.
For more information on the components of the connection string, see the Connection String URI Format documentation.
The following command-line options cannot be used in conjunction with
--password(if the URI connection string also includes the password)
Instead, specify these options as part of your
Specifies a resolvable hostname for the
mongodto which to connect. By default, the mongodump attempts to connect to a MongoDB instance running on the localhost on port number
To connect to a replica set, specify the
replSetNameand a seed list of set members, as in the following:
When specifying the replica set list format, mongodump always connects to the primary.
You can also connect to any single member of the replica set by specifying the host and port of only that member:
Changed in version 3.0.0: If you use IPv6 and use the
<address>:<port>format, you must enclose the portion of an address and port combination in brackets (e.g.
Specifies the TCP port on which the MongoDB instance listens for client connections.
Removed in version 3.0.
Enables IPv6 support and allows mongodump to connect to the MongoDB instance using an IPv6 network. Prior to MongoDB 3.0, you had to specify
--ipv6to use IPv6. In MongoDB 3.0 and later, IPv6 is always enabled.