Ubuntu 22.04 MongoDB 6.0 -> 7.current Upgrade Community Edition

I want to upgrade MongoDB Community Edition on Ubuntu 22.04 from 6.0 → 7.current

If I follow these instructions (as root):

curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
   --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
apt-get install -y mongodb-org

… is this going to upgrade in place and preserve my configuration and data?

2 Likes

Yes @Jack_Woehr this just upgrades the binaries.

But I know you know the rule, make sure you have backup before upgrading and test in a non-prod environment first :slight_smile:

1 Like

Thanks, all upgraded now and seems to be working fine.

I did need to do one manual step.
I told the upgrade to leave my extant /etc/mongod.cnf and discovered on restart that the key storage.journal.enabled seems to have become invalid since 6.x

It is always a good idea to follow the instructions on MongoDB site when upgrading.

(if you have a replica set or a sharded cluster, there is a dedicated page for each).

Carefully read all the steps, even if you previously upgraded from an older version as there might be differences. Failing to follow all the steps or ignoring one of them can lead to bad things in production. Don’t ask me how I know :slight_smile:

2 Likes

Ah, good point @denny99 … now I know where to look for upgrade instructions :sweat_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.