Migration process of MongoDB: 5.0.xx to 7.0.xx
✅ MongoDB Upgrade Checklist: 5.0 → 7.0
Section titled “✅ MongoDB Upgrade Checklist: 5.0 → 7.0”⚠️ Important concepts
Section titled “⚠️ Important concepts”- MongoDB upgrades must be major version by major version, no skipping feature compatibility upgrades.
- Your featureCompatibilityVersion (FCV) controls data features, not just binaries.
- If you skip an FCV step, you’ll get errors like “invalid feature compatibility version value”.
- Until version 0.9.7, Archihub used MongoDB 5.0.xx. From version 0.9.8 onwards, it uses MongoDB 7.0.xx, so if you are using Archihub 0.9.7 or earlier, you need to follow this migration process.
🟢 Preparation
Section titled “🟢 Preparation”1. Backup
Section titled “1. Backup”Backup the data volume generally located at /data/db in Archihub’s MongoDB container.
2. Check current FCV on MongoDB 5.0
Section titled “2. Check current FCV on MongoDB 5.0”Connect (mongosh or Compass):
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })Expected:
{ featureCompatibilityVersion: { version: "5.0" }, ok: 1 }🚀 Upgrade steps
Section titled “🚀 Upgrade steps”🔵 Step A: Upgrade to MongoDB 6.0
Section titled “🔵 Step A: Upgrade to MongoDB 6.0”1. Upgrade to MongoDB 6.0 in the docker-compose.yml file
Section titled “1. Upgrade to MongoDB 6.0 in the docker-compose.yml file”Replace the MongoDB image version in your docker-compose.yml file:
archihub_mongodb_server_01: image: mongo:6.0.24Then start the container again:
docker compose up --build -d2. Connect & verify version
Section titled “2. Connect & verify version”docker exec -it <container_name> mongod --versionThe container name should be archihub_mongodb_server_01 or similar, depending on your setup.
Check that it shows 6.0.24.
3. Verify FCV
Section titled “3. Verify FCV”db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })It should still show "5.0".
4. Update FCV to 6.0
Section titled “4. Update FCV to 6.0”db.adminCommand({ setFeatureCompatibilityVersion: "6.0" })Verify:
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })✅ Now it should show "6.0".
🔵 Step B: Upgrade to MongoDB 7.0
Section titled “🔵 Step B: Upgrade to MongoDB 7.0”1. Stop MongoDB 6.0
Section titled “1. Stop MongoDB 6.0”docker stop <container_name>2. Upgrade to MongoDB 7.0 in the docker-compose.yml file
Section titled “2. Upgrade to MongoDB 7.0 in the docker-compose.yml file”Replace the MongoDB image version in your docker-compose.yml file:
archihub_mongodb_server_01: image: mongo:7.0.21Then start the container again:
docker compose up --build -d3. Check version
Section titled “3. Check version”docker exec -it <container_name> mongod --version✅ Should show 7.0.21.
4. Check FCV
Section titled “4. Check FCV”db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })Expected to show "6.0" — that’s normal.
5. Update FCV to 7.0
Section titled “5. Update FCV to 7.0”db.adminCommand({ setFeatureCompatibilityVersion: "7.0" })Verify:
db.adminCommand({ setFeatureCompatibilityVersion: "7.0", confirm: true })✅ Now it should show "7.0".
🎉 Done!
Section titled “🎉 Done!”✅ Final status
Section titled “✅ Final status”| Binary version | FCV value |
|---|---|
| 7.0.x | 7.0 |