--- path: faq/repl-set-mongo/update/intro.mdx title: Upgrading a MongoDB replica set slug: intro pagination_next: null pagination_prev: null description: >- The general approach to a staged MongoDB replica set upgrade from version 4.x to 7.x, covering data compatibility and rolling update recommendations. keywords: - Passwork - MongoDB - Replica Set - replica set - upgrade - rolling update - featureCompatibilityVersion --- When upgrading MongoDB from version 4.x to 7.x, there are important considerations related to data compatibility and the order of the upgrade. :::danger A direct jump from **version 4.x to 7.x is not possible** because of changes in the data structure and functionality, which make older data incompatible with the newer MongoDB versions. ::: For a correct upgrade, we recommend the **rolling update** method. This process lets you upgrade MongoDB in stages. A **rolling update** keeps downtime to a minimum and reduces the risk of data loss or errors during the upgrade. :::warning The move to MongoDB 7.x must be done in stages, through the intermediate version 5.x, which ensures the data compatibility is changed correctly. ::: This prevents potential problems caused by incompatibility between versions and provides a smooth transition to the current MongoDB version. Step-by-step examples of migrating MongoDB 4.2 to MongoDB 7: - [**Ubuntu 22.04**](/faq/repl-set-mongo/update/ubuntu-22-04) - [**Ubuntu 20.04**](/faq/repl-set-mongo/update/ubuntu-20-04) - [**Debian 11**](/faq/repl-set-mongo/update/debian-11) - [**CentOS 8**](/faq/repl-set-mongo/update/centos-8)