VOOZH about

URL: https://thenewstack.io/how-to-plan-your-mongodb-upgrade/

⇱ How to Plan Your MongoDB Upgrade - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-01-29 06:37:57
How to Plan Your MongoDB Upgrade
sponsor-percona,sponsored-post-contributed,
Databases / Operations

How to Plan Your MongoDB Upgrade

MongoDB 4.4 and 5.0 will reach their end of life very soon, so it’s time to update your database software. Here’s how to begin.
Jan 29th, 2024 6:37am by Jan Wieremjewicz
👁 Featued image for: How to Plan Your MongoDB Upgrade
Featured image by Al Soot on Unsplash.
Percona sponsored this post.

MongoDB 4.4 will reach end of life (EOL) in February 2024, and MongoDB 5.0 will join it in August. If that’s not enough incentive to start planning your MongoDB upgrade, also consider that updating helps eliminate the security and compliance risks that can come from outdated software and offers features that can improve database performance, security and scalability.

Here are some of the new features in newer versions of MongoDB that might make you decide to upgrade sooner than later.

MongoDB 5.x

  • Live resharding for databases allows users to change shard keys as their workloads and databases evolve without incurring downtime.
  • Sharding for time-series collections enhances scalability and performance for temporal data management.
  • MongoDB 5.3 introduced clustered collections, which store data based on the associated clustered index keys. This prioritizes query performance over write speed when specific order matters for analytical queries.

MongoDB 6.x

  • Secondary and compound indexes in time-series collections boost read performance and enable new use cases such as geoindexing.
  • Enhanced change streams allow users to access both the previous and current states of modified documents, facilitating tasks like making downstream document updates and referencing deleted ones. This also supports data definition language (DDL) operations, such as creating or dropping collections and indexes.
  • Administrators can compress and encrypt audit events before storing them on disk using a Key Management Interoperability Protocol (KMIP)-compliant key-management system.

MongoDB 7.x

  • The ability to modify time-series data increases flexibility and control.
  • New aggregation pipeline operators and variables enable complex data transformations.
  • Wildcard indexes improve query performance for faster searches.
  • Queryable encryption maintains data confidentiality while allowing querying encrypted data.

How to Plan Your MongoDB Upgrade

Rather than giving you an overly technical guide to upgrading MongoDB, I’ll focus on some best practices that ring true for any MongoDB upgrade, whether you’re spurred on by 4.4 EOL or want to take advantage of the latest and greatest in 7.0. If you’re looking for a more technical, step-by-step walkthrough, you can watch Best Practices for Upgrading MongoDB 4.4.

1. Assess Your Current Environment

Though often overlooked, doing a comprehensive evaluation of your existing setup is essential to minimizing risks and downtime and enabling a smooth, successful upgrade.

It might sound obvious, but start by identifying which version of MongoDB you’re using. Knowing your current version is essential both for determining the gap between your existing setup and the latest version, and selecting the appropriate upgrade path.

Next, evaluate your resources and hardware. For example, do your current servers have sufficient CPU, memory and storage capacities to handle the new version efficiently? And thinking long term, will the new setup meet your future workloads and scaling needs?

Then, understand how you use MongoDB. Is it primarily used for transactional data? Analytical queries? Gaming applications? Different versions of MongoDB may be better suited for specific use cases, so it’s essential to evaluate if the new target version aligns with your database’s intended purpose.

Finally, before undertaking an upgrade, execute a thorough backup of your current data. This includes not just your database’s contents but your application data, customizations, replication configurations, indexes and security settings as well. Percona Backup for MongoDB is an open source community backup tool that can help you back up all of this data.

2. Test, Test and Test Again

Before implementing an upgrade in your production environment, it’s imperative — seriously, imperative — to create a separate sandbox or staging environment that mimics your production setup. Your goal is to identify any issues, conflicts or unexpected behaviors that may arise during the transition. This allows you to catch potential problems in a safe and controlled setting and try to avoid long periods of unexpected downtime.

3. Have a Rollback Plan, Just in Case

You can do all the prep in the world, but unforeseen difficulties happen. Try to find someone with experience doing upgrades to help you, whether they’re a member of your staff or a consultant. At the very least, in case something does go wrong, it’s crucial to have a way to roll back to the previous version of your database.

A comprehensive MongoDB rollback plan typically includes:

  • Doing backups of data and configurations.
  • Documenting the current state.
  • Communicating your plans to key stakeholders.
  • Identifying your rollback trigger(s).
  • Creating detailed, documented rollback procedures.
  • Monitoring your environment.
  • Analyzing and understanding what went wrong with the upgrade.

4. Decide Whether to Use a Stable or a Development Version

Stable versions of MongoDB have undergone extensive testing and are deemed production-ready, whereas those still in development may not be fully ready for prime time. Your choice between these versions should be guided by your organization’s risk tolerance and your upgrade’s specific objectives.

5. Determine Your Upgrade Steps and Path

While the upgrade process will vary depending on the individual environment, the general recommended path for a basic MongoDB upgrade is:

  • Take a backup.
  • Download the new binaries.
  • Keep the feature compatibility value (FCV) set to Current/Previous version.
  • Shut down Mongo processes in the correct order, in a rolling fashion according to your system type.
  • Replace your current binaries with the new binaries.
  • Start Mongo processes in the correct order using the rolling fashion required by your system type.
  • Wait 24-48 hours (depending on your database) to ensure there are no problems.
  • Set the FCV to the new version.

It’s best to conduct the upgrade process slowly and steadily. Progress from your current version through each major release until you’ve reached your intended version. For example, if you are on 4.4, that process would look like 4.4.1+ to 5.0 to 6.0 to 7.0. Do not jump from 4.4 to 7.0.

Next Steps

Once you complete your upgrade, conduct some post-upgrade testing and optimization to ensure your new MongoDB database is running as it should. We’ll cover that in our next article.

If you need assistance with your MongoDB upgrade, Percona can help you create a personalized upgrade plan. Our experts will help you upgrade MongoDB, proactively identifying and mitigating blockers, incompatibilities and potential performance issues during and beyond the upgrade cycle.

Percona is widely recognized as a world-class open source database software, support, and services company for MySQL®, MongoDB®, and PostgreSQL® databases. We are dedicated to helping make your databases and applications run better through a unique combination of expertise and open source software.  
Learn More
The latest from Percona
TRENDING STORIES
Jan Wieremjewicz is a senior product manager at Percona, leading the products for MongoDB and PostgreSQL. He has vast experience in developing, deploying and maintaining enterprise systems. Professionally, he is passionate about simple solutions that solve complicated problems and user...
Read more from Jan Wieremjewicz
Percona sponsored this post.
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.