MongoDB 4.4 to 5.0 Upgrade
1) Updating Secondary Nodes from MongoDB 4.4 to 5.0
First, all MongoDB secondary nodes are updated to version 5.0 one by one.Stop MongoDB service
Add MongoDB 5.0 repository
Install MongoDB 5.0
Start MongoDB service
Check replica set status
2) Stepping Down a Node in Primary Role to Secondary Role
Connect to the primary node and step down the primary node’s role to secondary to allow a new primary node to be selected.Connect to Primary Node
Step down Primary Node to Secondary Node
Check new Primary Node
3) Updating Node That Left Primary Role from MongoDB 4.4 to 5.0
Stop MongoDB service
Add MongoDB 5.0 repository
Install MongoDB 5.0
Start MongoDB service
Check replica set status
4) MongoDB 5.0 Feature Compatibility Check
After all Nodes have transitioned to MongoDB 5.0, before transitioning to MongoDB 6.0, the feature compatibility setting is set to 5.0 (on Primary Node).Connect to Primary Node
Check feature compatibility
Update feature compatibility
MongoDB 5.0 to 6.0 Upgrade
5) Updating Secondary Nodes from MongoDB 5.0 to 6.0
After ensuring all MongoDB replicas have transitioned to version 5.0, you can transition to version 6.0. First, start by updating all secondary nodes sequentially.Stop MongoDB service
Add MongoDB 6.0 repository
Install MongoDB 6.0
Start MongoDB service
Check replica set status
6) Stepping Down a Node in Primary Role to Secondary Role
Connect to Primary Node
Step down Primary Node to Secondary Node
Check new Primary Node
7) Updating Node That Left Primary Role from MongoDB 5.0 to 6.0
Stop MongoDB service
Add MongoDB 6.0 repository
Install MongoDB 6.0
Start MongoDB service
Check replica set status
8) MongoDB 6.0 Feature Compatibility Check
After all Nodes have transitioned to MongoDB 6.0, the feature compatibility setting is set to 6.0 (on Primary Node).Connect to Primary Node
Check feature compatibility
Update feature compatibility
MongoDB 6.0 to 7.0 Upgrade
9) Updating Secondary Nodes from MongoDB 6.0 to 7.0
After ensuring all MongoDB replicas have transitioned to version 6.0, you can transition to version 7.0. First, start by updating all secondary nodes sequentially.Stop MongoDB service
Add MongoDB 7.0 repository
Install MongoDB 7.0
Start MongoDB service
Check replica set status
10) Stepping Down a Node in Primary Role to Secondary Role
Connect to Primary Node
Step down Primary Node to Secondary Node
Check new Primary Node
11) Updating Node That Left Primary Role from MongoDB 6.0 to 7.0
Stop MongoDB service
Add MongoDB 7.0 repository
Install MongoDB 7.0
Start MongoDB service
Check replica set status
12) MongoDB 7.0 Feature Compatibility Check
After all Nodes have transitioned to MongoDB 7.0, the feature compatibility setting is set to 7.0 (on Primary Node).Connect to Primary Node
Check feature compatibility
Update feature compatibility
MongoDB 7.0 to 8.0 Upgrade
13) Updating Secondary Nodes from MongoDB 7.0 to 8.0
After ensuring all MongoDB replicas have transitioned to version 7.0, you can transition to version 8.0. First, start by updating all secondary nodes sequentially.dnf instead of apt, the upgrade commands change as follows:Stop MongoDB service
Add MongoDB 8.0 repository
Install MongoDB 8.0
Start MongoDB service
Check replica set status
14) Stepping Down a Node in Primary Role to Secondary Role
Connect to Primary Node
Step down Primary Node to Secondary Node
Check new Primary Node
15) Updating Node That Left Primary Role from MongoDB 7.0 to 8.0
Stop MongoDB service
Add MongoDB 8.0 repository
Install MongoDB 8.0
Start MongoDB service
Check replica set status
16) MongoDB 8.0 Feature Compatibility Check
After all Nodes have transitioned to MongoDB 8.0, the feature compatibility setting is set to 8.0 (on Primary Node).Connect to Primary Node
Check feature compatibility
Update feature compatibility

