Updating MongoDB 7.0 to 8.0¶
Updating older versions
For details on updating earlier SEAL MongoDB versions, see the corresponding SEAL MongoDB documentation.
Overview¶
The following instructions include the update of both, single system and cluster.
In case of a single system perform all instructions, except of those concerning the replica set.
In case of a cluster perfom the instructions as stated in the subchapters.
The standard procedure is as follows:
-
Check the
featureCompatibilityVersion
Key -
Update the database as described in the instructions below.
Your current
mongod.conf
configuration file will be renamedmongod.conf.bak
.The database content will remain untouched.
-
In an editor compare the new
mongod.conf
configuration file tomongod.conf.bak
and change the necessary settings.
Checking the featureCompatibilityVersion
Key¶
-
Open a shell.
-
Connect to the primary host of the replica set (
localhost
in a single server system):mongosh --tls -tlsAllowInvalidCertificates --host <primary host>
-
Check the
featureCompatibilityVersion
key:db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
The result should be similar to this:
{ featureCompatibilityVersion: { version: '7.0' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1745505640, i: 1 }), signature: { hash: Binary.createFromBase64('AAAAAAAAAAAAAAAAAAAAAAAAAAA=', 0), keyId: Long('0') } }, operationTime: Timestamp({ t: 1745505640, i: 1 }) }
-
If the result shows a version lower than 7.0, set the
featureCompatibilityVersion
key to7.0
:db.adminCommand({ setFeatureCompatibilityVersion: '7.0', confirm: true })
Updating the Database¶
Hint - cluster
In a cluster, you have to perform every step of the following instructions on all cluster servers before going on to the next step.
-
Stop MongoDB:
sudo systemctl stop mongod
-
Open a shell.
-
In an editor, open the
mongod.conf
configuration file and change the necessary settings. -
Restart MongoDB:
sudo systemctl start mongod