Skip to content

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”
  • 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.

Backup the data volume generally located at /data/db in Archihub’s MongoDB container.


Connect (mongosh or Compass):

db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })

Expected:

{ featureCompatibilityVersion: { version: "5.0" }, ok: 1 }

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.24

Then start the container again:

Ventana de terminal
docker compose up --build -d
Ventana de terminal
docker exec -it <container_name> mongod --version

The container name should be archihub_mongodb_server_01 or similar, depending on your setup.

Check that it shows 6.0.24.


db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })

It should still show "5.0".


db.adminCommand({ setFeatureCompatibilityVersion: "6.0" })

Verify:

db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })

✅ Now it should show "6.0".


Ventana de terminal
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.21

Then start the container again:

Ventana de terminal
docker compose up --build -d

Ventana de terminal
docker exec -it <container_name> mongod --version

✅ Should show 7.0.21.


db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })

Expected to show "6.0" — that’s normal.


db.adminCommand({ setFeatureCompatibilityVersion: "7.0" })

Verify:

db.adminCommand({ setFeatureCompatibilityVersion: "7.0", confirm: true })

✅ Now it should show "7.0".


Binary versionFCV value
7.0.x7.0