MongoDB Documentation, Release 3.0.4 1. Stop the surviving mongod instances. To ensure a clean shutdown, use an existing control script or use the db.shutdownServer() method. 2. Create a backup of the data directory (i.e. dbPath ) of the surviving members of the set. 3. Restart one of the mongod instances without the --replSet parameter. 1. Stop the surviving mongod instances. To ensure a clean shutdown, use an existing control script or use the db.shutdownServer() method. 2. Move the data directories (i.e. dbPath ) for all the members except db0.example.net , so that all the members except db0.example.net have empty data directories. For example: 4. Start each member of the replica set normally. 3. Move the data files for local database (i.e. local. $_{*}$) so that db0.example.net has no local database. For example 5. Connect to db0.example.net in a mongo shell and run rs.initiate() to initiate the replica set. 6. Add the other set members using rs.add() . For example, to add a member running on db1.example.net at port 27017 , issue the following command: Chapter 9. Replication 640 See also: Optional rs.add("db1.example.net:27017") MongoDB performs an initial sync on the added members by copying all data from db0.example.net to the added members. Resync a Member of a Replica Set (page 633) mkdir /data/local-old mv /data/db/local * /data/local-old/ mv /data/db /data/db-old use admin db.shutdownServer() For example, to use the db.shutdownServer() method, connect to the server using the mongo shell and issue the following sequence of commands: Reconfigure by “Breaking the Mirror” This option selects a surviving replica set member to be the new primary and to “seed” a new replica set. In the following procedure, the new primary is db0.example.net . MongoDB copies the data from db0.example.net to all the other members. When possible, re-deploy a replica set to provide redundancy and to protect your deployment from operational inter- ruption. The data is now accessible and provided by a single server that is not a replica set member. Clients can use this server for both reads and writes. If you have a backup of the database you may instead remove this data. use admin db.shutdownServer() For example, to use the db.shutdownServer() method, connect to the server using the mongo shell and issue the following sequence of commands: