Backup a Sharded Cluster with Filesystem Snapshots (page 256) Use file system snapshots back up each compo- nent in the sharded cluster individually. The procedure involves stopping the cluster balancer. If your system configuration allows file system backups, this might be more efficient than using MongoDB tools. 

Backup a Sharded Cluster with Database Dumps (page 258) Create backups using mongodump to back up each component in the cluster individually. 

Schedule Backup Window for Sharded Clusters (page 259) Limit the operation of the cluster balancer to provide a window for regular backup operations. 

Restore a Single Shard (page 260) An outline of the procedure and consideration for restoring a single shard from a backup. 

Restore a Sharded Cluster (page 260) An outline of the procedure and consideration for restoring an entire sharded cluster from backup. 

## Backup a Small Sharded Cluster with mongodump 

Overview If your sharded cluster holds a small data set, you can connect to a mongos using mongodump . You can create backups of your MongoDB cluster, if your backup infrastructure can capture the entire backup in a reasonable amount of time and if you have a storage system that can hold the complete MongoDB data set. 

See MongoDB Backup Methods (page 184) and Backup and Restore Sharded Clusters (page 254) for complete infor- mation on backups in MongoDB and backups of sharded clusters in particular. 

Important: By default mongodump issue its queries to the non-primary nodes. 

To back up all the databases in a cluster via mongodump , you should have the backup (page 410) role. The backup (page 410) role provides the required privileges for backing up all databases. The role confers no additional access, in keeping with the policy of least privilege . 

To back up a given database, you must have read access on the database. Several roles provide this access, including the backup (page 410) role. 

To back up the system.profile (page 291) collection, which is created when you activate database profiling (page 215), you must have additional read access on this collection. Several roles provide this access, including the clusterAdmin (page 408) and dbAdmin (page 406) roles. 

Changed in version 2.6. 

To back up users and user-defined roles (page 325) for a given database, you must have access to the admin database. MongoDB stores the user data and role definitions for all databases in the admin database. 

Specifically, to back up a given database’s users, you must have the find (page 419) action (page 419) on the admin database’s admin.system.users (page 291) collection. The backup (page 410) and userAdminAnyDatabase (page 412) roles both provide this privilege. 

To back up the user-defined roles on a database, you must have the find (page 419) action on the admin database’s admin.system.roles (page 291) collection. Both the backup (page 410) and userAdminAnyDatabase (page 412) roles provide this privilege. 

Considerations If you use mongodump without specifying a database or collection, mongodump will capture collection data and the cluster meta-data from the config servers (page 670). 

You cannot use the --oplog option for mongodump when capturing data from mongos . As a result, if you need to capture a backup that reflects a single moment in time, you must stop all writes to the cluster for the duration of the backup operation. 

