Will your MongoDB upgrade break? Check it with UCFM

November 13, 2026
Author
Jean da Silva
Share this Post:

You were assigned one of the most common, yet feared, tasks in the life of a database administrator:

  • You need to upgrade your cluster.

Upgrades are needed for many reasons, whether to fix an existing bug or to keep the environment under support and eligible to receive security fixes. Either way, the task is yours.

The binary swap is the easy part. The hard part is everything before it:

  • The environment is critical.
  • The dataset is huge, and you have no idea what is behind that size.
  • The configuration carries parameters nobody remembers setting.
  • … and the list goes on.

How it used to be

A major upgrade in MongoDB moves one release at a time, regardless of the jump you plan. For example: “Going from 6.0 to 8.0”

  • That means two upgrades, 6.0 to 7.0 and then 7.0 to 8.0, each with its own binary swap and its own featureCompatibilityVersion (FCV) change.

So the homework is not done once. It is done per step, and for every step the checklist looks something like this:

  1. Read the compatibility changes page and the release notes of the target version.
  2. Compare each mongod.conf and every setParameter against what was removed or renamed.
  3. Look for removed commands, operators, and aggregation stages in the application, in views, and in custom roles.
  4. Ah! Are you using a Sharded Cluster? Cool, you have to do that multiple times for different nodes and shards, along with checking the balancer, the config servers, and every shard.
  5. […]

None of this is hard per se. It is just long, tedious, easy to get wrong, and different for every version step. And there was no single command that answered the real question:

Is this deployment ready for the upgrade? If not, what should I fix first?

Meet UCFM

UCFM (Upgrade Checker For MongoDB) tells you whether a MongoDB or Percona Server for MongoDB deployment is ready to upgrade, and what to fix first.

If you have worked with MySQL, the idea may sound familiar: That’s because ucfm is heavily inspired by MySQL Shell’s upgrade checker, util.checkForServerUpgrade().

MySQL DBAs have had that answer for years.

  • You point it at a server and a target version, and it runs a numbered list of checks.
  • Each check says “No issues found” or lists what it found as an Error, a Warning or a Notice, with the objects involved and a link to the documentation.
  • The output ends with a count and a plain sentence: fix the errors before you upgrade.

The value is not in any single check. It is in having one place that knows every change between two versions, applies all of them to your deployment, and gives you a short list of things to fix.

That was the idea behind it: a tool that tells you what is right and what is wrong in your environment, and answers that same question one upgrade step at a time.

If you are one step earlier and still deciding which path to take, allow me to recommend the MongoDB Upgrade Roadmap; it can help you with the upgrade steps.

What it does and what it does not

ucfm is a read-only tool that works by checking facts from every member it can reach on your deployment.

You point it at one node, and it discovers the rest of the replica set, or the config servers, shards and mongos. Then it runs three kinds of checks:

  • What disappears between versions.
  • What the release notes say.
  • Whether a behavior change affects you.

At the end of the check, it will generate a list with the findings and recommended actions.

Worth mentioning that ucfm does not upgrade anything. It reads and reports; the upgrade is still yours.

What it does give you is the answer to the question from the beginning of this post. Before the maintenance window, you know what could break and where.

How to use it

Install

One command downloads the latest release, verifies its checksum and installs ucfm into /usr/local/bin (or ~/.local/bin when you are not root). Running it again upgrades.

curl -fsSL https://raw.githubusercontent.com/jenunes/ucfm/main/install.sh | bash

 

Create a read-only user

The tool needs clusterMonitor, readAnyDatabase and a small role that can read users, roles and view definitions; for that we create a custom role ucfmViewSecurity which holds the necessary permissions so you can drop it afterwards if you prefer:

use admin
db.createRole({
  role: "ucfmViewSecurity",
  privileges: [
    { resource: { cluster: true }, actions: ["viewUser"] },
    { resource: { db: "", collection: "" }, actions: ["viewUser", "viewRole"] },
    { resource: { db: "", collection: "system.views" }, actions: ["find"] }
  ],
  roles: []
})

Then create the user granting the necessary permissions:

use admin
db.createUser({
  user: "ucfm",
  pwd: passwordPrompt(),
  roles: ["clusterMonitor", "readAnyDatabase", "ucfmViewSecurity"]
})

Note: On a sharded cluster, create it through a mongos and also on the primary of every shard. ucfm connects to shard members directly, and they only accept shard-local users. If you forget one, it warns you and names the shard.

Check readiness

Point --uri at any replica set member, or at a mongos(if sharded cluster), and name the target version:

ucfm check --uri "mongodb://ucfm@db1:27017/?authSource=admin" --target 7.0

If you prefer, leave the password out of --uri and ucfm asks for it. For scripts, use the UCFM_URI environment variable or --uri-file.

The report starts with deployment-wide checks (upgrade path, FCV, health, sharding state), then one block per upgrade step. A shortened example:

The MongoDB deployment at db1:27017 (replica set rs0, 3 members), Percona
Server for MongoDB 6.0.29-23, will now be checked for compatibility issues for
upgrade to MongoDB 7.0 (path 6.0 → 7.0)...

================================================================================
Deployment-wide checks
================================================================================

1) Upgrade path (upgrade-path)
   No issues found: from 6.0 (current) to 7.0 (target) is a supported upgrade
      path.

2) Server versions across members (binary-versions-consistent)
   No issues found: all 3 members run 6.0.29-23.

3) featureCompatibilityVersion (fcv-matches-binary)
   No issues found: FCV is 6.0 on 3 members, the same as their binaries.

[...]

================================================================================
Upgrade 6.0 → 7.0
Checked against Percona Server for MongoDB 7.0, psmdb-7.0.45-24
================================================================================

[...]

20) PSMDB journal options (psmdb-journal-option-ignored)
   Notice: storage.journal.enabled / --journal / --nojournal are set. PSMDB 7.0
      and later always journal and ignore these settings, logging a startup
      warning.

   - db1:27017, db2:27017, db3:27017

   Solution:
   - Remove the journal settings from the configuration.

   More information:
     https://docs.percona.com/percona-server-for-mongodb/7.0/install/upgrade-from-60.html

[...]

24) Usage of removed commands (command-removed-in-use)
   Warning: Clients ran these commands since the servers started (longest uptime
      1d); 7.0 no longer implements them and will answer CommandNotFound.

   - availableQueryOptions (6 calls)

   Solution:
   - Find the applications or tools issuing these commands (profiler, logs,
     $currentOp) and update them before upgrading.

   More information:
     https://www.mongodb.com/docs/manual/release-notes/7.0-compatibility/

[...]

================================================================================
Errors:   0
Warnings: 3
Notices:  4

Checks with warnings:
   - 24) Usage of removed commands (command-removed-in-use)
   - 31) Floating-point rounding in $add (add-rounding)
   - 35) $natural hint and sort values (natural-hint-values)

No errors were found. Review the 3 warnings before upgrading.

Before going through the findings, read the top of the report: it tells you what is being checked, and the first checks tell you what could not be checked and how to fix that.

The tool checks one major upgrade at a time. When the target is further away, check 1 shows the full path and the report covers the next step only; run it again after each upgrade.

The exit code follows the result (0 clean, 1 warnings, 2 errors, 3 tool failure), so the check fits in a pipeline. Add --format json for machine-readable output, or --deep-check to sample documents for the changes that depend on stored data.

Audit production settings

Upgrades are a good moment to look at the rest of the house. ucfm audit compares the deployment with the MongoDB Production Notes and Operations Checklist:

ucfm audit --uri "mongodb://ucfm@db1:27017/?authSource=admin"

You can also append it to the ucfm check with --with-audit:

ucfm check --uri "mongodb://ucfm@db1:27017/?authSource=admin" --target 7.0 --with-audit

One run, one report with both sections.

With that, I believe you already have what you need for your next maintenance window. When you want to go further, like checking the operating system of each host or collecting a snapshot to analyze somewhere else, feel free to check the UCFM documentation, which holds more details.

Conclusion

UCFM was born of a desire to simplify a process and to answer the question highlighted at the beginning, a question that, until now, had no single command to answer.

Still, it does not replace your judgment, your backup, or the official upgrade procedure. It replaces the long manual checklist with a single read-only pass over the deployment you already have: one step at a time, with findings you can act on before the maintenance window.

Install it, point it at a node, pick a target, and read the report. Fix the errors, run it again, and let me know how it goes.

Suggestions, fixes, and features are all welcome; the project is open source at: github.com/jenunes/ucfm.

 

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved