iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
You can upgrade MongoDB on Ubuntu without losing data, but not by treating the change as an ordinary apt upgrade. The safe method is a recoverable change: follow MongoDB’s release-specific version path, create and restore-test a backup, preserve configuration and package state, upgrade binaries in the order required by your topology, keep the old feature compatibility version (FCV) during a burn-in period, and raise FCV only after the upgraded deployment and applications have passed validation.
There is no universal “latest-version” command. The correct intermediate releases depend on the version you run, the target release, Ubuntu codename, deployment topology, drivers, and storage layout. Before MongoDB 9.0, self-managed deployments cannot skip minor releases. A verified restore and an explicit rollback decision are what make the operation recoverable; a dump that has never been restored is not proof that you can recover.
Free tools Windows power users keep installed
One-click scans. No signup required.
What “without losing data” actually means
An upgrade changes server binaries and, eventually, the data features those binaries may write. It does not guarantee zero risk. A defensible no-data-loss plan gives you:
- A supported sequence of MongoDB releases, including any required intermediate versions.
- A backup made before package or binary changes, with its files checked and a restore performed on an isolated instance.
- A copy of the current configuration, package versions, repository definition, permissions, and service state.
- A topology-appropriate sequence that preserves availability where redundancy exists.
- A burn-in period with the previous FCV before new on-disk features are enabled.
- A written decision for stopping applications, redirecting traffic, restoring data, or reinstalling the former binaries if validation fails.
A logical dump is a recovery mechanism, not a shortcut around MongoDB’s supported upgrade path. MongoDB advises that source and destination deployments use the same major version or compatible FCV for dump and restore scenarios, and restoration into a newer deployment is not its recommended way to perform an upgrade.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
Identify your starting point before touching apt
Record the exact server, shell, package, service, operating-system, and topology details. Run these commands as an administrator where required:
mongod --version
mongosh --quiet --eval 'db.version()'
sudo systemctl status mongod --no-pager
apt-cache policy mongodb-org mongodb-org-server
Capture the output in the change record. The two version commands can differ if the binary on your path is not the binary managed by the service, so investigate any mismatch before proceeding.
Record topology and FCV
Connect with a suitably privileged account and run:
db.adminCommand({ hello: 1 })
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
The hello result indicates whether the server is a standalone or part of a replica set and, for a replica set, whether this member is primary or secondary. For a replica set, also run:
db.adminCommand({ replSetGetStatus: 1 })
Do not begin while any member is in ROLLBACK or RECOVERING. MongoDB’s upgrade procedures require healthy members. Resolve replication lag, elections, storage errors, and synchronization problems first.
Record the files and operating-system context
- Ubuntu release and codename (
lsb_release -aor the contents of/etc/os-release). - The MongoDB apt source file and signing-key configuration.
- Installed package names and versions, including every
mongodb-org*package. - The service unit and configuration path, normally
/etc/mongod.conffor a package installation. - The configured
storage.dbPath, log path, bind addresses, TLS files, authentication settings, and replica-set name. - Filesystem ownership, modes, mount points, free space, and any encryption or volume-management details.
- Driver and application versions, connection strings, read/write concerns, and maintenance or failover behavior.
Save a copy of the configuration and repository files outside the database data directory. Do not assume a package reinstall will recreate custom permissions, certificates, systemd overrides, or mount points.
Recommended Free Tools
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Create a backup you can actually restore
Use the Database Tools release appropriate for your server. The cited current tools documentation lists support for server versions 4.2 through 9.0 and Ubuntu 16.04 through 24.04 for that tools release. Use the same tools release for restore when possible; MongoDB warns that format differences can otherwise cause restore failures or incorrect data.
Logical dump for a replica-set deployment
For a full dump from a replica-set member, include the oplog so writes that occur during the dump can be replayed:
mongodump --uri='mongodb://USER:PASSWORD@HOST/?authSource=admin'
--out /var/backups/mongodb/$(date -u +%Y%m%dT%H%M%SZ)
--oplog
Protect credentials from shell history and process listings in your environment; use the authentication method approved for your operations team. The --oplog option records operations that occur while the dump runs, and mongorestore --oplogReplay can replay them. MongoDB documents important limits: --oplog requires a full dump from a replica-set member, cannot be used for a sharded-cluster dump, and is incompatible with options that restrict the dump to selected databases, collections, or other subsets.
Standalone and sharded cases
A standalone has no oplog-based replica-set snapshot path. If you cannot convert it to a replica set before the maintenance, schedule a write outage, stop application writes, and take the approved backup while the data is quiescent. A sharded cluster needs the sharded-cluster backup procedure; do not add --oplog to a sharded-cluster dump merely because it was used for a replica set.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Logical dumps do not automatically reproduce every operating-system or deployment artifact. Preserve users and roles, certificates, keyfiles, replica-set configuration, indexes, and any metadata required by your selected backup method. If your organization uses filesystem or managed snapshots instead, verify that the method is supported for your storage engine and topology and that it captures a consistent database state.
Verify the dump before the outage
- Confirm the command completed successfully and that the output contains the expected databases and collections.
- Check file sizes, timestamps, ownership, available space, and checksums according to your backup policy.
- Copy the backup to storage that will remain available if the Ubuntu host or volume fails.
- Record the exact MongoDB and Database Tools versions used to create it.
Perform a restore test, not just a dump
Restore to an isolated host or temporary instance with network access blocked from production. Use the same Database Tools release where possible. Do not restore over a live production data path.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
- Install a server version and FCV compatible with the dump and the documented restore procedure.
- Start the isolated instance with a separate
dbPath, port, and log file. - Restore the dump. For a replica-set dump that includes an oplog, use
mongorestore --oplogReplayas appropriate for the documented procedure. - Compare database and collection counts with production records. Check representative indexes, users, roles, and application queries.
- Run a small set of read and write tests using the same authentication and driver behavior as the application.
- Record the restore duration, warnings, failures, and the person who approved the result.
A restore test that fails because of missing permissions, an incompatible tools format, absent key material, or an overlooked metadata dependency is a finding to fix before the upgrade, not an inconvenience to defer.
Choose the supported MongoDB version path
Read the exact MongoDB version and upgrade page for your source and target releases. MongoDB publishes separate procedures for standalone, replica-set, and sharded deployments. Determine every allowed intermediate version. In self-managed deployments before MongoDB 9.0, minor releases cannot be skipped, so a direct jump from an older minor release to the newest package is not supported simply because apt offers it.
Check all of the following for each hop:
- Source and target major and minor versions and the required intermediate releases.
- Ubuntu codename and architecture support for the target repository.
- Driver compatibility and any removed commands, changed defaults, or wire-protocol requirements.
- Storage-engine, authentication, TLS, and configuration changes called out in the release notes.
- Whether the target procedure requires a particular FCV, a clean shutdown, a stepdown, or a minimum number of healthy members.
Do not label an upgrade “direct” merely because several package versions can be downloaded. The release-specific procedure is authoritative.
Control Ubuntu’s apt state
MongoDB packages should come from the official repository for the target MongoDB series and your Ubuntu codename. Save the current source definition before changing it, then configure the target repository exactly as described in MongoDB’s Ubuntu installation guide. Do not mix repositories for different MongoDB series during one hop.
- Copy the existing MongoDB source file and record its signing-key configuration.
- Use
apt-cache policy mongodb-org mongodb-org-serverto confirm which versions are installed, available, and coming from which origin. - Change the source to the target series only after the version path is approved.
- Run
sudo apt-get updateand inspect the candidate versions before installing anything. - Install the target package set as one planned change, checking that server, shell, database, tools, and other
mongodb-org*components are on compatible versions. - After validation, either allow or deliberately prevent future unattended upgrades. Document the decision.
apt-get will select a newer candidate when one is available. If that is not desired, place the relevant MongoDB component packages on hold and record how the holds will be removed during the next planned upgrade:
sudo apt-mark hold mongodb-org mongodb-org-database mongodb-org-server mongodb-org-mongos mongodb-org-tools
Package names vary by release; verify the installed list with dpkg -l 'mongodb-org*' and hold the components that actually exist. A hold is change control, not a substitute for security and lifecycle planning.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Standalone upgrade runbook
A standalone normally requires downtime because there is no other member to serve reads or become primary. MongoDB recommends considering conversion to a replica set before upgrading if your availability requirements justify the additional operational work.
- Announce the maintenance window and stop or drain application writes. Confirm that background jobs, queues, and scheduled tasks cannot reconnect and write during the shutdown.
- Complete the backup and successful restore test. Copy the configuration, package list, repository file, and service overrides.
- Stop MongoDB cleanly with
sudo systemctl stop mongod. Confirm it is inactive withsudo systemctl status mongod --no-pager. - Change apt to the approved next release and install the exact compatible package set. Do not skip an intermediate release prohibited by the version guide.
- Start the service with
sudo systemctl start mongod, then inspectsudo systemctl status mongod --no-pagerand the MongoDB log. - Check
mongod --version, connect withmongosh, and verify databases, users, indexes, permissions, and representative queries. - Keep the previous FCV during burn-in. Only after application and operational checks pass should you perform the target release’s FCV command.
- Re-enable application traffic gradually and monitor errors, latency, disk growth, logs, and backup jobs.
Replica-set upgrade runbook
A replica set provides failover, but only if members are healthy and upgraded in a controlled sequence. Plan for majority availability and follow the target release’s member-order rules.
- Confirm the set has a healthy primary and secondaries, acceptable replication lag, sufficient disk space, and no member in
ROLLBACKorRECOVERING. - Verify that applications use a replica-set-aware connection string and that their read and write concerns behave as expected during elections.
- Back up and restore-test the deployment. Preserve each member’s configuration, keyfiles, certificates, service overrides, and package state.
- Upgrade one secondary at a time. Stop or otherwise remove the member according to the release-specific procedure, install the approved packages, restart it, and wait for it to return to a healthy state and catch up.
- Repeat for the remaining secondaries, never upgrading multiple members simultaneously unless the official procedure explicitly permits it.
- Step down the primary using the release-appropriate command and election procedure, allow a healthy upgraded secondary to become primary, then upgrade the former primary.
- Confirm all members are on the prerequisite binary version, replication is healthy, and the set retains the required majority.
- Run application tests against the new primary and monitor elections, replication lag, logs, and resource use.
- Keep the old FCV until the burn-in checks pass. Raise FCV only on the primary and only when the required majority of data-bearing members is available.
If a member cannot rejoin, stop and diagnose its logs, network, keyfile, permissions, and storage before proceeding. Do not force an FCV change while a member is performing an initial sync.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Keep binary upgrade and FCV enablement separate
MongoDB explicitly separates these operations: “Upgrading the MongoDB binaries and enabling the new version’s features are two separate steps.” New features can write data in formats that older binaries cannot read, so the safer sequence is to run newer binaries with the previous FCV while you validate the deployment.
Burn-in checks before changing FCV
- All intended members report the target binary version and are in valid states.
- Replication is caught up and remains stable through normal workload peaks.
- Logs contain no new storage, authentication, replication, or driver errors.
- Backups complete and a scheduled restore check remains viable.
- Representative reads, writes, transactions, indexes, aggregation pipelines, and administrative tasks work through the production drivers.
- Monitoring, alerts, TLS, auditing, and maintenance jobs still function.
Raise FCV with the target release’s exact syntax
Use the version-specific MongoDB procedure for the target. For the cited 9.0 procedure, the form is:
db.adminCommand({ setFeatureCompatibilityVersion: "9.0", confirm: true })
Do not copy that value for another release. FCV changes write internal state and require the required majority of data-bearing members; they must not be run during an initial sync. Record the command result and re-check:
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
Validate the upgraded deployment
Validation should be explicit rather than a single successful service restart.
| Area | What to check | Pass condition |
|---|---|---|
| Binary and packages | mongod --version, dpkg -l 'mongodb-org*', and apt-cache policy |
All intended components are on the approved release and repository. |
| Service | systemctl status mongod and startup logs |
Service is active without fatal or repeated startup errors. |
| Topology | hello and, for replica sets, replSetGetStatus |
Expected primary/secondary roles and healthy member states. |
| Data | Database and collection counts, indexes, sample documents, and representative queries | Results match the pre-upgrade baseline and application expectations. |
| Replication | Lag, elections, optime progress, and majority write behavior | No sustained lag or unexpected elections. |
| Security | Authentication, roles, TLS, certificates, keyfiles, and audit behavior | Applications and administrators authenticate with least-privilege access. |
| Operations | Backups, monitoring, alerts, log rotation, disk growth, and scheduled jobs | Normal jobs complete and alerts remain meaningful. |
Keep the old package files and repository information until the change is accepted. Record the final FCV, package versions, configuration checksum, and validation evidence.
Rollback and recovery decisions
A backup alone is not a rollback plan. Decide in advance which condition causes you to stop traffic, step down a member, restore data, or reinstall the previous binaries.
- If the service will not start, preserve logs and the data directory, verify configuration and permissions, and use the documented package downgrade or restore procedure for that release.
- If an upgraded replica-set member fails before FCV changes, leave it out of service, repair or reinstall it with the approved binary, and allow it to resynchronize according to MongoDB’s procedure.
- If application validation fails, stop or redirect writes before they diverge further, then choose between correcting the issue and restoring the verified backup.
- If FCV has been raised, do not assume that simply installing older binaries is safe. Newer feature behavior may have written data older binaries cannot read; use the target release’s downgrade guidance and be prepared to restore the pre-upgrade backup.
- Never delete the original backup, configuration copy, or logs until the retention period and change approval are complete.
Common mistakes and their fixes
Jumping straight to the newest package
Symptom: apt proposes a release several minor versions ahead. Fix: stop, read the source-to-target upgrade path, and perform each required hop with its own validation.
Using a dump as the upgrade mechanism
Symptom: an operator plans to dump production and restore directly into a newer server. Fix: use the dump to prove recoverability and follow the supported binary upgrade path; restore only as a deliberate recovery or migration procedure compatible with the documented versions.
Adding --oplog to an unsupported dump
Symptom: the command targets a standalone, sharded cluster, or a restricted subset. Fix: use the topology-appropriate backup procedure. MongoDB’s --oplog option is for a full replica-set-member dump and has documented incompatibilities.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Raising FCV immediately after restart
Symptom: the binary upgrade and feature activation are treated as one step. Fix: keep the previous FCV, complete health and application checks, then run the target release’s exact FCV command on the primary.
Ignoring apt drift
Symptom: an unattended update changes MongoDB after the planned maintenance. Fix: inspect candidates with apt-cache policy, hold the relevant packages when appropriate, and document the unhold procedure.
Skipping restore verification
Symptom: the dump exists but has never been opened. Fix: restore it on an isolated host, compare counts and representative queries, and correct missing metadata, credentials, or tool-version issues before production changes.
Quick Recap
Standalone or replica set: which plan applies?
| Characteristic | Standalone | Replica set |
|---|---|---|
| Availability during upgrade | Normally requires a maintenance outage. | Can preserve service through controlled failover if members are healthy. |
| Upgrade order | Stop, replace binaries, restart, validate. | Upgrade secondaries one at a time, step down the primary, then upgrade it. |
| Backup consideration | Quiesce writes for a consistent backup if no replica-set method is available. | A full member dump may include the oplog for replay. |
| FCV requirement | Raise only after standalone validation. | Requires the required majority of data-bearing members and no initial sync. |
| Strategic recommendation | Consider converting to a replica set before a major upgrade if availability matters. | Maintain healthy membership and replication before every change. |
Final pre-change checklist
- Source version, target version, Ubuntu codename, topology, and driver compatibility are documented.
- The release-specific path confirms every required intermediate version.
- Configuration, repository files, package versions, permissions, certificates, and service state are saved.
- The backup completed, was copied safely, and passed an isolated restore test.
- Applications, operators, and monitoring owners know the maintenance and rollback triggers.
- Replica-set members are healthy, or standalone writes are scheduled to stop.
- Apt candidates are correct and unintended package upgrades are held or deliberately managed.
- Binaries will be upgraded first, with the previous FCV retained during burn-in.
- FCV will be changed only with the target release’s exact command and required majority.
- Post-upgrade data, replication, security, application, backup, and monitoring checks are assigned and recorded.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

