## Upgrading a Replica Set 

1.8.x secondaries can replicate from 1.6.x primaries . 

1.6.x secondaries cannot replicate from 1.8.x primaries. 

Thus, to upgrade a replica set you must replace all of your secondaries first, then the primary. 

For example, suppose you have a replica set with a primary, an arbiter and several secondaries. To upgrade the set, do the following: 

1. For the arbiter: 

(a) Shut down the arbiter. 

(b) Restart it with the 1.8.x binary from the MongoDB Download Page$^{890}$. 

2. Change your config (optional) to prevent election of a new primary. 

It is possible that, when you start shutting down members of the set, a new primary will be elected. To prevent this, you can give all of the secondaries a priority of 0 before upgrading, and then change them back afterwards. To do so: 

(a) Record your current config. Run rs.config() and paste the results into a text file. 

(b) Update your config so that all secondaries have priority 0 . For example: 

config = rs.conf() { "_id" : "foo", "version" : 3, "members" : [ { "_id" : 0, "host" : "ubuntu:27017" }, { "_id" : 1, "host" : "ubuntu:27018" }, { "_id" : 2, "host" : "ubuntu:27019", "arbiterOnly" : true } { "_id" : 3, "host" : "ubuntu:27020" }, { "_id" : 4, "host" : "ubuntu:27021" }, ] } config.version++ 3 rs.isMaster() { "setName" : "foo", 

