Upgrading MongoDB under Rocket.Chat

Rocket.Chat 8.x needs MongoDB 8.0 or later running as a replica set. This page explains how to check engine versions, sequence the database upgrade and plan backups and rollback for your deployment.

On this page

Why MongoDB comes first when upgrading Rocket.Chat to 8.x

Before you upgrade a self-hosted Rocket.Chat workspace to 8.x, confirm that your MongoDB version is supported by the target Rocket.Chat release, because the database must be ready before the application moves. Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, so a standalone database or an older engine will block the upgrade path. Each Rocket.Chat release lists its minimum MongoDB version under Engine versions in its release notes, and that list is the authoritative check for the exact release you plan to install. If your database is older than the minimum, or is not supported by the target release, you must upgrade MongoDB first and only then move Rocket.Chat.

Work through the MongoDB path as its own project with a backup taken before each step. Record the current MongoDB version, confirm the deployment is running as a replica set, and identify every intermediate MongoDB version your path requires, since a jump may need to pass through a supported release. Use the Rocket.Chat guidelines for updating as the starting point for the order of operations, then confirm the MongoDB steps against the official MongoDB upgrade documentation for your deployment method.

Plan for high availability at the same time. Rocket.Chat's system requirements strongly recommend a three-member replica set for high availability, so decide early whether your upgrade will convert a single node into a three-member set, and budget the maintenance window and the rollback point for that change. A replica set also changes how you take backups and how Rocket.Chat connects, which is why the database work should be scoped and approved before anyone touches the application.

What changes in the database layer for 8.x

This table compares the MongoDB requirements that Rocket.Chat 8.x adds to your current database layer, with the action each one needs. Read each row against your present MongoDB version and topology, and treat any row you cannot confirm as a blocker to resolve before the upgrade window.

ChangeImpactAction needed
Minimum MongoDB versionRocket.Chat 8.x runs on MongoDB 8.0 and later, so earlier MongoDB versions cannot run the upgraded server.Record your current MongoDB version and upgrade it before you change Rocket.Chat.
MongoDB 8.2 supportThe supported range includes 8.2, so 8.2 is a valid target within the 8.x line.Confirm the exact target version against the Engine versions entry for your chosen Rocket.Chat release.
Replica set requirementRocket.Chat 8.x requires MongoDB to run as a replica set, so a standalone database will not meet the requirement.Convert any standalone deployment to a replica set and test the connection string before upgrading Rocket.Chat.
Three-member replica setA three-member replica set is strongly recommended for high availability, so a two-member or single-node set leaves less room to recover from a node failure.Decide whether to add members, and confirm the sizing and placement with your database team.
Engine versions per releaseEach Rocket.Chat release lists its minimum MongoDB version under Engine versions, so the requirement can change between releases.Read the Engine versions section of the exact target release notes and record the minimum before scheduling each step.

What to back up and inventory before touching MongoDB

A MongoDB upgrade under Rocket.Chat changes the database that holds every message, file reference and setting, so the preparation matters as much as the upgrade itself. The cards below cover what to record, copy and test before anyone runs a version change, and each one feeds the next step in the sequence.

Verified full backup and restore

Take a full backup of the MongoDB database and the uploaded files store, then restore it into a separate environment and confirm that users can sign in and that recent messages and files open. A backup that has never been restored is an assumption, not a rollback plan. Record where the backup is stored, who can restore it, and how long a restore took in your environment, because that figure sets the minimum change window. Treat an untested backup as no backup.

Updating guidelines

Current MongoDB and Rocket.Chat versions

Record the exact Rocket.Chat version and the exact MongoDB version that run in production, and check both against the engine versions listed in the release notes for your target. Rocket.Chat 8.x needs MongoDB 8.0 or later, so a MongoDB release that is older than that must be moved forward before Rocket.Chat changes. Write the version pairs down in the change record so the rollback target is never guessed.

System requirements

Deployment component inventory

List how Rocket.Chat is deployed: Docker Compose files, Kubernetes manifests, the Helm chart values and versions, and any image tags pinned in them. Note which Node.js runtime is bundled in the official Docker image or Helm chart, so you do not install or change Node.js separately by mistake. Confirm which components are in the same release train, because a mismatch between a container image and the database version is a common cause of failed starts.

Staging copy of the workspace

Restore a recent backup into a staging environment that mirrors production's MongoDB topology, Rocket.Chat configuration and integrations. Run the MongoDB step and the Rocket.Chat step there first, then sign in as a test user, send messages, upload a file and check your identity provider, webhooks and any custom apps. Staging is where you learn whether a step takes longer than the window you planned.

Replica set health checks

Rocket.Chat 8.x requires MongoDB running as a replica set, and a three-member replica set is strongly recommended for high availability. Before the change, confirm that a primary is elected, that every member is healthy and replicating, and that the oplog has enough headroom for the work you plan. A replica set that is already degraded will make the upgrade harder to reverse, so fix it first.

Replica set requirements

Change window and communication plan

Agree a change window with the business owners, name the people who make the go or no-go decision, and set the rollback trigger in advance. Tell users when messaging, file uploads and mobile or desktop sign-ins may be interrupted, and publish the same message to support channels. Confirm the window length against your staging results rather than a generic estimate, and keep a named contact available for the full window.

How to sequence the MongoDB upgrade with checks and rollback points

The sequence turns a risky database change into a series of small, verified steps, each with a stop condition and a way back before Rocket.Chat itself is touched.

  1. Confirm the target Rocket.Chat release and engine versions

    Identify the Rocket.Chat release you plan to run, then open its entry in the release notes and find the Engine versions section, which lists the minimum MongoDB version that release supports. Rocket.Chat 8.x runs on MongoDB 8.0 and later, including 8.2. Record the minimum version and the release number in your change plan. Done when the target MongoDB version is written down and approved by the owner of the database. Rollback point: nothing has changed yet, so stopping here costs only time.

  2. Record the current MongoDB version and path

    Check the MongoDB version your deployment runs today on every node, including any hidden or arbiter members. Compare it with the target and with the upgrade path in the MongoDB documentation, which determines which intermediate versions you must pass through. An unsupported MongoDB must be upgraded before Rocket.Chat, so a gap here changes the whole plan. Done when you have a written list of version steps, each tied to a documented stop. Rollback point: no change has been made to the cluster.

  3. Take and test a full backup

    Take a full backup of the database with the method your team has standardized, and record where it is stored, its size and its checksum. Then restore it into a separate, isolated environment and confirm that Rocket.Chat starts against it and that a sample of rooms, messages and users reads correctly. Include the Rocket.Chat file storage location in the backup scope, because the database alone does not hold uploaded files. Done when a test restore has been completed and signed off. Rollback point: this backup is the reference for every later step.

  4. Confirm or convert the replica set

    Rocket.Chat 8.x requires MongoDB running as a replica set, and a three-member replica set is strongly recommended for high availability. Confirm that the deployment already runs as a replica set and that all members are healthy and replicating. If it runs as a standalone server, plan the conversion as a separate change with its own backup and test, and follow the MongoDB documentation for the exact procedure. Done when the replica set status shows a primary and the expected secondaries with acceptable replication lag. Rollback point: stop before any version change and restore the test backup if the conversion misbehaves.

  5. Upgrade MongoDB one documented step at a time

    Upgrade the replica set one version at a time, in the order the MongoDB documentation specifies, using its rolling procedure so that secondaries are upgraded before the primary. Do not skip intermediate versions unless the documentation allows it for your path. Complete each step fully before starting the next. Done when every member reports the intended version and the compatibility setting is set as the documentation requires. Rollback point: after each step, the previous version and the backup remain available as the way back until the final version is validated.

  6. Verify replica set health and application connectivity

    After each database step, confirm that a primary is elected, all members are healthy, replication lag is within your agreed threshold and the oplog is not under pressure. Then connect a test Rocket.Chat instance to the upgraded set and check that it starts, sends and receives messages, and writes to the database without errors in its logs. Done when both the database health checks and the application checks pass in a test environment. Rollback point: if checks fail, stop, and revert to the previous step or restore the backup in line with your documented procedure.

  7. Upgrade Rocket.Chat after the database is stable

    Only after MongoDB is at the required version and stable, upgrade Rocket.Chat to the target release following its update guidelines for your deployment type, whether Docker Compose, Kubernetes or another method. Run the supported migrations, then check that users can sign in, messages flow, file uploads work and the admin console reports the expected version. Done when smoke tests pass and the support team confirms the workspace is usable. Rollback point: keep the previous Rocket.Chat image or chart version and the database backup until the upgrade has been accepted.

How the procedure changes by deployment type

The MongoDB steps for Rocket.Chat 8.x are the same logical work in every environment, but the place where you run them changes with the deployment type. Start by identifying which of three shapes you run: a single-host Docker Compose setup, a Kubernetes or Helm deployment, or a multi-instance or microservice design. The reference architectures suggest one instance with a MongoDB replica set for up to 500 concurrent users, load-balanced instances linked by NATS above 500, and microservices on Kubernetes with the official Helm chart above 5,000. Your concurrency figures decide which shape the upgrade has to fit, so confirm your current peak concurrent users before you plan the window.

On a single host, the MongoDB container or package usually sits beside the Rocket.Chat container on the same machine. Confirm which image tag and compose file pin the database version, whether the replica set is already initialized, and where the data volume lives and how it is backed up. Because one host carries both services, the database step and the Rocket.Chat step share one maintenance window, and a failed database step blocks the application step. For Kubernetes, confirm whether MongoDB is run by an operator, a managed service or a chart you own, and whether the upgrade is applied through that operator or chart. Check that the Helm release values and the MongoDB version your Rocket.Chat release requires are reviewed together, since the two can drift apart. Multi-instance and microservice designs add more moving parts: the database upgrade touches every instance that depends on it, and you must confirm the replica set members, NATS connectivity and version alignment before any application node moves.

The multi-instance and microservice designs require a paid Rocket.Chat plan, so the cost of planning the database upgrade belongs in the same quote as the licensing decision. Ask whoever prepares the quote to state which components are covered, including the database tier, and who performs each MongoDB step in your environment. Whichever shape you run, record the answers in writing before the window is scheduled, and have your platform team confirm the backup and rollback path for that specific topology.

What makes the MongoDB upgrade take longer

This table lists the factors that stretch a MongoDB upgrade under Rocket.Chat beyond the simple version step. Read each row as a question to answer about your own deployment before you set a window, since the answers decide how many steps, backups and test cycles you need.

DriverWhy it mattersWhat to check
Data sizeLarger databases take longer to back up, copy and restore, so every rollback point costs more time.Current database size, growth since the last backup and how long a full restore took in a test.
Distance from MongoDB 8.0Rocket.Chat 8.x needs MongoDB 8.0 or later, so older servers may need intermediate upgrade steps first.Current MongoDB version, the engine version listed in the target Rocket.Chat release notes and the vendor's documented upgrade path.
Replica set state8.x requires a replica set, so a standalone server must be converted and a degraded set must be repaired first.Member count, health of each member, replication lag and whether a three-member set is in place.
Number of deployments and environmentsEach deployment, staging copy and development instance repeats the backup, upgrade and test steps.Inventory of every MongoDB host tied to Rocket.Chat and the order in which each environment will be upgraded.
Custom integrations and direct database accessScripts, reporting tools, bots or apps that read or write MongoDB directly may break or need changes after the upgrade.Every process that connects to the database, its driver version and whether it has been tested against the new server version.
Backup and restore speedA backup is only a rollback point once a restore has been proven, and slow restores extend the window for each step.Time for a full restore into a separate host, backup method used, and whether point-in-time recovery is available.
Air-gapped or restricted networksInstallers, drivers and MongoDB packages may need to be transferred and verified manually before the upgrade starts.Whether package mirrors are reachable, how binaries are approved and moved in, and who signs off on each transfer.

Common questions about MongoDB upgrades for Rocket.Chat

How much does a MongoDB upgrade for Rocket.Chat cost?

No price is published for this work, and DeployOpen does not publish a price list. A quote follows from a written scope. The main cost drivers are the number of MongoDB steps between your current version and the version your target Rocket.Chat release requires, the size and count of your databases, whether you run a single node or a replica set, how your hosting is built (self-managed VMs, containers, Kubernetes or a managed service), and how many Rocket.Chat instances depend on the database. Ask the quote to separate the assessment, the rehearsal in a non-production copy, the production steps, the backup and rollback work, and post-upgrade checks. Confirm whether any work recurs, such as later Rocket.Chat or MongoDB upgrades under a retainer.

How long does a MongoDB upgrade under Rocket.Chat take?

Duration depends on the steps required, your environment and how much testing you want before production. Each Rocket.Chat release lists its minimum MongoDB version under Engine versions in its release notes, so the number of intermediate MongoDB versions you must pass through sets the plan length. Other timing factors include change windows, the size of your data, the rehearsal copy you can build, how many environments need the same change, and approval cycles in regulated settings. Ask for a timeline in the written scope with named milestones and the downtime window you can accept. No duration is given here because none was supplied for this work.

What does the client team need to provide for the upgrade?

The client team typically provides access to the current Rocket.Chat and MongoDB hosts, the deployment definitions (Docker Compose files, Helm values or configuration management code), current backup and restore arrangements, and a named owner who can approve changes. Engineers who manage DNS, TLS, load balancers and storage should be available for the window. You also need the list of Rocket.Chat versions and MongoDB versions in each environment, and a decision on who signs off the rollback plan. Agree in writing who holds the backup copies and where they are stored before the first step begins.

Can our internal team run the MongoDB upgrade themselves?

Often yes, if the team has database administration experience, can test restores and has time for a rehearsal. The work is sequential and easy to get wrong: each Rocket.Chat release names its minimum MongoDB version, so you must confirm the path, take backups before each step, and check that the database is running as a replica set, which Rocket.Chat 8.x requires. A three-member replica set is strongly recommended for high availability. The question to answer honestly is whether your team can rehearse the full sequence and roll back without the production team learning the procedure during the change window. Partner help is typically scoped as a fixed engagement with written deliverables.

What happens if we skip the MongoDB upgrade?

Rocket.Chat 8.x runs on MongoDB 8.0 and later, and an unsupported MongoDB must be upgraded before Rocket.Chat, so skipping the database step blocks the Rocket.Chat upgrade. The risk on the other side is also real: a Rocket.Chat version past end of life gets no security or bug fixes, and cloud services such as the push notification gateway, Marketplace and Omnichannel integrations stop working. Rocket.Chat also says unsupported versions may lose the ability to connect with official mobile and desktop clients. Keeping an old database version without a plan means your exposure grows while the application stays in place.

Can Rocket.Chat 8.x run on a single-node MongoDB?

Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, so a standalone single node does not meet the stated requirement. A three-member replica set is strongly recommended for high availability. Rocket.Chat's reference architectures suggest one instance with a MongoDB replica set for up to 500 concurrent users, so a small deployment still needs the replica set configuration even when it has one application instance. Confirm the exact topology with the release notes for your target version and with your own recovery objectives before you build the database tier. The single-node question is therefore a replica set question in practice.

How the upgrade phases and rollback points connect

The path starts with an inventory of the current MongoDB and Rocket.Chat engine versions, then a backup and restore test before anything changes. Each later phase, from the staging rehearsal through the MongoDB upgrade to the Rocket.Chat upgrade and verification, hands off only after the previous step passes. Every phase has a rollback edge to the last verified backup, so the team can see where it can safely return if a step fails.

Upgrade phases with rollback edges to the last verified backup.

How to test and roll back if the upgrade fails

Define the rollback point before each MongoDB step starts, because a rollback is only as good as the backup it restores. Before touching the database, take a backup, restore it into a scratch environment, and confirm that Rocket.Chat starts against the restored copy at the version you are running now. The rollback plan then names three things: the backup identifier, the MongoDB and Rocket.Chat versions that worked before the step, and the person who authorizes the restore. Write these down in the change record so the decision does not depend on memory during an outage.

Test scope should cover the paths users and integrations depend on, not only whether the service responds. Confirm login through your configured identity provider, including LDAP or SAML if you use them, and check that existing sessions and multi-factor prompts behave as expected. Send and receive messages in a channel and a direct conversation, upload a file and open it, and run the integrations your teams rely on, such as incoming and outgoing webhooks. Connect the official mobile and desktop clients to confirm they still sign in. Finally, perform a restore test from the backup taken for this step, since a backup that has never been restored is not yet proven.

If any test fails, roll back to the last working state instead of debugging in production. Stop Rocket.Chat, restore the verified MongoDB backup, and start the previous Rocket.Chat and MongoDB versions, then repeat the test list before reopening the workspace to users. Confirm the exact rollback steps for your deployment (Docker Compose, Kubernetes or a managed host) and the MongoDB version that the previous Rocket.Chat release supports, using the engine versions in its release notes. Plan the downtime for a full restore, since it is usually longer than the upgrade itself, and tell users when the workspace will return.

How DeployOpen scopes and delivers Rocket.Chat database upgrades

DeployOpen plans and carries out the MongoDB upgrade that Rocket.Chat 8.x requires, inside the infrastructure you control. The work starts from your current engine version, the Rocket.Chat release you are moving to, and your deployment layout, then moves through each step with a backup and a documented check before the next one begins.

How we scope

  • We confirm your current MongoDB version and the minimum engine version listed for your target Rocket.Chat release.
  • We record whether your deployment is a single instance, load-balanced or Kubernetes microservices, and whether the replica set is already in place.
  • The written scope lists each MongoDB step, the backup method for each step, and the rollback criteria agreed before work starts.

How we build

  • We stage each MongoDB step in a non-production copy of your data and record the result before touching production.
  • We confirm replica set health, member count and write concern after each step, and check Rocket.Chat connectivity before the next step.
  • We test restore from each backup on a separate system so the rollback path is proven, not assumed.

How we hand over

  • You receive a runbook with the exact order of steps, commands, configuration changes and verification checks for your environment.
  • The documentation records each backup, its location, its checksum and the restore procedure your team can repeat.
  • We walk your operations team through the runbook and the rollback decision points before the production window.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer for the next Rocket.Chat or MongoDB upgrade.
  • Ask any provider to confirm who performs the production steps, who holds backup access and how support is billed before you sign.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.