Sametime – Upgrading MongoDB from 4.4 to 7

Initially Sametime 12 supported MongoDB 4.4, so most of the existing installations, at least for my customers, are still running on that version.
Now 4.4 is going EOL and is wise to upgrade to the latest version, MongoDB 7.

I have done an upgrade of a production ST 12.0.2 from MongDB 4.4 to 7, without any issues.
There are some things you need to be aware of, is not just “next, next, next….” 🙂

First of all MongoDB is NOT like Domino, you can’t upgrade directly from an old version to the latest, you have to go 4.4 -> 5 -> 6 -> 7. Not very nice for us used to Domino, but it is what it is.

Upgrade from 4.4 to 5

Follow the note: https://www.mongodb.com/docs/v5.3/release-notes/5.0-upgrade-standalone

1)Enter mongo with command:
mongo

2)Verify the version that is 4.4
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )

3)close mongo
systemctl stop mongod

4)install the new executables following the note:
https://www.mongodb.com/docs/v5.3/installation

delete the mongo 4.4 repo file under /etc/yum.repos.d/

5) create the new mongo repo file 5
/etc/yum.repos.d/mongodb-org-5.0.repo

[mongodb-org-5.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/5.0/x86_64/
gpgcheck=1
enabled=1 gpgkey=https://pgp.mongodb.com/server-5.0.asc

6)run the update command
dnf update

7)once updated run the mongod command and pull up the service mongod
systemctl start mongod

It will fail so stop the service and do the following:
systemctl stop mongod
rm -rf /tmp/mongodb-27017.sock
chown -R mongod:mongod /var/lib/mongo
chown -R mongod:mongod /var/log/mongodb
chmod R 777 /var/run/mongod
systemctl start mongod

9) change Mongo compatibility
mongo
db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )
systemctl stop mongod
systemctl start mongod

Mongo is updated to version 5

Upgrade from 5 to 6

Do the same but use the correct repo:

https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-standalone/#std-label-6.0-upgrade-standalone

Upgrade from 6 to 7

For mongo 7 follow the instructions here:
https://www.mongodb.com/docs/manual/release-notes/7.0-upgrade-standalone/


Then comment out the following parameter from /etc/mongod.conf:
# journal:
# enabled: true

Set the following parameter to never:

echo never | tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null && echo never | tee /sys/kernel/mm/transparent_hugepage/defrag > /dev/null