MongoDB Documentation, Release 3.0.4 Upgrade a MongoDB Instance Replace the Existing Binaries Upgrade Sharded Clusters Example $^{86}$http://downloads.mongodb.org/ 237 5.2. Administration Tutorials To upgrade a mongod or mongos instance, use one of the following approaches: Important: Always backup all of your data before upgrading MongoDB. This section describes how to upgrade MongoDB by replacing the existing binaries. The preferred approach to an upgrade is to use the operating system’s package management tool and the official MongoDB packages, as described in Install MongoDB (page 5). To upgrade a mongod or mongos instance by replacing the existing binaries: To upgrade a sharded cluster: Given the following config string: mongos --configdb cfg0.example.net:27019,cfg1.example.net:27019,cfg2.example.net:27019 You would upgrade the config servers in the following order: (a) cfg2.example.net (b) cfg1.example.net (c) cfg0.example.net 3. Upgrade each mongod config server (page 670) individually starting with the last config server listed in your mongos --configdb string and working backward. To keep the cluster online, make sure at least one config server is always running. For each config server upgrade, follow the instructions below in Upgrade a MongoDB Instance (page 237) 2. Upgrade each mongos instance by following the instructions below in Upgrade a MongoDB Instance (page 237). You can upgrade the mongos instances in any order. 1. Disable the cluster’s balancer, as described in Disable the Balancer (page 717). 4. Restart the instance. 3. Replace the existing MongoDB binaries with the downloaded binaries. 2. Shutdown the instance. 1. Download the binaries for the latest MongoDB revision from the MongoDB Download Page 86 and store the binaries in a temporary location. The binaries download as compressed files that uncompress to the directory structure used by the MongoDB installation. • Upgrade the instance using the operating system’s package management tool and the official MongoDB pack- ages. This is the preferred approach. See Install MongoDB (page 5). • Upgrade the instance by replacing the existing binaries with new binaries. See Replace the Existing Binaries (page 237).