## Reconfigure by Forcing the Reconfiguration 

Changed in version 2.0. 

This procedure lets you recover while a majority of replica set members are down or unreachable. You connect to any surviving member and use the force option to the rs.reconfig() method. 

The force option forces a new configuration onto the member. Use this procedure only to recover from catastrophic interruptions. Do not use force every time you reconfigure. Also, do not use the force option in any automatic scripts and do not use force when there is still a primary . 

To force reconfiguration: 

1. Back up a surviving member. 

2. Connect to a surviving member and save the current configuration. Consider the following example commands for saving the configuration: 

cfg = rs.conf() printjson(cfg) 

3. On the same member, remove the down and unreachable members of the replica set from the members array by setting the array equal to the surviving members alone. Consider the following example, which uses the cfg variable created in the previous step: 

cfg.members = [cfg.members[0] , cfg.members[4] , cfg.members[7]] 

4. On the same member, reconfigure the set by using the rs.reconfig() command with the force option set to true : 

rs.reconfig(cfg, {force : true }) 

This operation forces the secondary to use the new configuration. The configuration is then propagated to all the surviving members listed in the members array. The replica set then elects a new primary. 

Note: When you use force : true , the version number in the replica set configuration increases signif- icantly, by tens or hundreds of thousands. This is normal and designed to prevent set version collisions if you accidentally force re-configurations on both sides of a network partition and then the network partitioning ends. 

5. If the failure or partition was only temporary, shut down or decommission the removed members as soon as possible. 

## Reconfigure by Replacing the Replica Set 

Use the following procedure only for versions of MongoDB prior to version 2.0. If you’re running MongoDB 2.0 or later, use the above procedure, Reconfigure by Forcing the Reconfiguration (page 639). 

These procedures are for situations where a majority of the replica set members are down or unreachable. If a majority is running , then skip these procedures and instead use the rs.reconfig() command according to the examples in replica-set-reconfiguration-usage . 

If you run a pre-2.0 version and a majority of your replica set is down, you have the two options described here. Both involve replacing the replica set. 

Reconfigure by Turning Off Replication This option replaces the replica set with a standalone server. 

