MongoDB upgrade v4.4 -> v6.0

Daniel Pletzke
1 min readFeb 4, 2023
Photo by Rubaitul Azad on Unsplash

When upgrading between 4.4 and 6.0 on MacOS locally, I needed to upgrade to 5.0 first, change configuration, then upgrade to 6.0.

My errors while attempting to run mongod included:

Invalid feature compatibility version value, expected ‘5.0’ or ‘5.3’ or ‘6.0’

Invalid featureCompatibilityVersion document in admin.system.version

The steps I followed to fix this were:

brew services stop mongodb-community@4.4
brew uninstall mongodb-community@4.4
brew install mongodb-community@5.0
brew services start mongodb-community@5.0
mongosh
//confirm prompt reads MongoDB: 5.*.*
db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )
//exit prompt
brew services stop mongodb-community@5.0
brew uninstall mongodb-community@5.0
brew install mongodb-community
mongosh
//confirm prompt reads MongoDB: 6.*.*
db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )
//exit prompt

Sources:

--

--