Rocket.Chat backup and restore with mongodump

A self-hosted Rocket.Chat workspace is only as recoverable as its database and file storage. This page explains how mongodump and mongorestore protect each, and how to prove a restore works before an upgrade.

On this page

Rocket.Chat backup and restore with mongodump: what must be protected

mongodump and mongorestore protect the MongoDB database that holds Rocket.Chat's messages, rooms, users and settings, but they do not protect uploads stored outside MongoDB, so files kept in an object store, a WebDAV share or on a file system need their own backup job and their own restore test. Treat the two as one recovery set: a database restored without the matching files leaves messages that point to attachments that no longer exist. Before you pick a method, confirm where your uploads live, because the answer decides whether the database dump is the only data store you need to capture.

You need recoverable data before an incident such as accidental deletion, a failed disk, ransomware or a bad configuration change, and before every major upgrade, since a failed upgrade is much easier to reverse from a backup taken minutes earlier. Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, as described in the Rocket.Chat system requirements. That requirement shapes the method: on a replica set, a consistent point-in-time copy usually needs the oplog captured during the dump, so confirm with your MongoDB version and tooling whether you use the --oplog option, a filesystem snapshot or a managed backup service before you write the schedule.

Write down, for your environment, the MongoDB topology (standalone is not the target for 8.x, so confirm your replica set members and where backups run), the upload storage backend, the Rocket.Chat release currently pinned, and the owner who approves a restore. Those four facts drive the rest of this topic. Ask your MongoDB operator or database vendor which backup tools they support for your version, and confirm the retention period and off-site copy requirements with your compliance team before any schedule is set.

Choosing the mongodump approach for standalone or replica set databases

A standalone MongoDB server holds one copy of the data and has no oplog that other members can replay. It suits small or test workspaces where a short gap in recent messages is an accepted risk. Rocket.Chat 8.x requires a replica set, so a standalone database is a lab setup, and any backup routine built on it should be tested against the topology you will actually run.

  • Simple command: Run mongodump with --uri against the single node, and add --gzip and --archive to write one compressed file.
  • No oplog capture: The --oplog option applies only to replica set members, so a standalone dump reads each collection at the moment it is scanned.
  • Lower setup effort: No member selection or read preference is needed, so the same command runs from the host or from a container with network access to the database.
  • Reuse for staging: A dump can seed a test environment, but confirm the target is a replica set before restoring it for any 8.x instance.

Confirm the MongoDB topology your Rocket.Chat version requires in the official system requirements before you rely on a standalone backup.

Backup options and when each fits

This table compares four ways to protect the MongoDB database behind Rocket.Chat: mongodump full dumps, scheduled dumps, volume snapshots and a managed provider's backup service. Read each row for restore granularity, consistency and operator effort, then match the option to your hosting and MongoDB topology. Confirm vendor behavior before relying on any option.

OptionRestore granularity and consistencyOperator effortWhen it fits
mongodump full dumpRestores the whole database or chosen collections. Consistency across a replica set needs --oplog so the dump captures a point in time.Manual to run; you own scripts, storage and retention of dump files.Small or standalone deployments, pre-upgrade snapshots and moving data between hosts.
Scheduled mongodumpSame granularity as a manual dump, with restore points set by the schedule. Gaps between runs mean lost messages.Moderate: cron or CronJob setup, monitoring of job results and periodic restore tests.Teams that need regular copies without a platform backup tool and can accept the gap between runs.
Filesystem or volume snapshotsRestores the whole data volume. Consistency depends on journaling and whether the snapshot is taken with the database quiesced or on a replica set member; confirm with your storage vendor.Moderate to high: storage-layer configuration, snapshot schedules and restore procedures that differ by platform.Self-managed MongoDB on storage that supports consistent snapshots, where fast whole-node recovery matters more than single-collection restores.
Managed MongoDB provider backupGranularity, point-in-time options and retention depend on the provider. Confirm whether restores can target a single database or collection.Low for routine backups; restores still need runbooks and access controls.Hosting on a managed MongoDB service where the provider's backup features meet your recovery and residency requirements.
Uploads stored outside MongoDBNot covered by any database option in this table if files use GridFS, S3, MinIO or the file system. Back them up separately.Adds a second backup job and restore step that must match the database point.Any deployment with file storage outside the database. Confirm the storage vendor's versioning and replication settings.

Backing up uploads stored outside MongoDB

A mongodump backup covers the database only. Files that users upload to Rocket.Chat are not stored inside MongoDB when you use S3, MinIO, Google Cloud Storage, WebDAV or the file system, so a database backup alone leaves them out. Restoring that database onto a new server gives you message history with attachment records that point to objects that no longer exist. Users see broken links and downloads that fail, and the gap is easy to miss because the messages themselves look intact. Before you write a backup plan, confirm where your workspace keeps uploads in the administration settings and in your storage configuration, and list every bucket, share or directory that holds them.

Pair the database dump with a copy of the file store taken from the same point in time, as close together as your environment allows. Start the file store backup and the database dump in the same maintenance window, and record the time each one began and ended. Object storage often supports versioning or replication, which can keep older copies available, but versioning alone does not tell you which object versions match a given database dump. Plan a restore order that brings back the database and the file store from the same window, then check a sample of recent attachments against message records after each restore. Ask your storage team to confirm how their snapshots, replication and retention rules interact with any delete operations in Rocket.Chat, since deleted uploads may be removed from the store on a schedule you control.

The storage choice decides how much work this is. A local file system or a single shared volume can be copied with the same tools you use for other server data, while object storage and GridFS each need their own export method. Choosing where uploads live is covered in the file storage topic, and switching later can strand older files in the previous location, which means your backup scope must include both locations until the migration is finished and verified. Write down the storage backend, its access credentials, its retention settings and the owner of each piece, so that the backup runbook names every system a restore will need.

Running a backup and restore in order

This sequence captures a consistent MongoDB dump, a matching copy of uploads, and the release and settings needed to rebuild the workspace, then restores those pieces in the order Rocket.Chat expects so you can prove the copy works before you rely on it.

  1. Decide whether to quiesce writes

    The platform owner decides whether the workspace can run a live dump or needs a short write freeze, based on how much message activity an inconsistent snapshot could miss and on whether the team can tolerate a pause. Put the decision in the change record with the window and who approved it. Done means the team has a written choice, a named owner for the window, and a way to tell users when writes are paused or resumed. Confirm with your MongoDB topology whether a live dump from the replica set is acceptable in your environment before you proceed.

  2. Run mongodump against the replica set

    The database administrator runs mongodump against the Rocket.Chat replica set, using the connection string and credentials for a member that holds a complete copy of the data, and writes the output to a dated directory on storage separate from the server. Keep the command, options, and MongoDB version in the run log. Done means the process exits with a success status and the output directory contains the database folders with their metadata files. Check the log for errors and compare the size of the output with the previous run, since a sharply smaller dump is a sign something was skipped.

  3. Back up the matching file store

    The platform owner copies the uploads that Rocket.Chat keeps outside MongoDB, such as a file system path, object storage bucket, or WebDAV target, and takes it from the same point in time as the dump so message attachments still resolve after a restore. If you use GridFS, the files already sit in the dump, so confirm that rather than copying a second source. Done means the copy completes, its checksum or object count matches the source at the time of capture, and the dump and file store are tagged with the same backup identifier. Confirm how your storage provider handles consistent snapshots before you rely on them.

  4. Record the release and server settings

    The Rocket.Chat administrator writes down the exact release number running on the workspace, the image or chart tag, the MongoDB version, the environment variables and configuration files, and the reverse proxy and storage settings. Store this record next to the dump, not only in the server. Done means someone who was not part of the backup could rebuild the same release from the record alone. Restores fail most often when the version differs from the data's origin, so this record is what lets you pick the matching release later.

  5. Restore MongoDB into a separate test instance

    Before touching production, the database administrator runs mongorestore into an isolated MongoDB replica set that matches the production version and topology, using the dump from the earlier step. This keeps the restore order intact and avoids overwriting live data. Done means mongorestore reports no failed documents, the collection counts in the test database match the figures captured during the dump, and the restore log has no unresolved errors. This check proves the dump is usable, which a successful dump alone does not.

  6. Restore the file store and point Rocket.Chat at the database

    Restore the file store copy to the location the test Rocket.Chat instance expects, then start the same release recorded in the settings step against the restored MongoDB database. Bring the instance up in the same order you would use in production, with the database reachable first and uploads available second. Done means the instance starts without migration errors, the administrator can sign in, and the logs show no missing-file warnings for recent attachments.

  7. Verify message and file access

    A tester signs in to the restored instance with a non-administrator account, opens several channels and direct messages from different periods, and downloads a sample of attachments from both older and recent uploads. The tester compares what they see with a short list of expected checks prepared before the test. Done means the tester has signed off on each check, any missing files are logged with the backup identifier, and the team has decided whether the backup is accepted for use before an upgrade or other change. Only resume normal writes on production after this sign-off.

Protecting backup files and restore access

A Rocket.Chat backup holds the same messages, user records and account data as the live database, often with long-lived copies kept off-site. The cards below cover the controls that keep those copies protected, limited to the people who need them, and deleted when they expire.

Treat backups as production data

A mongodump archive contains every message, direct message, user record and stored setting in the workspace. Classify backup files at the same level as the live database and list every place they are written, including staging hosts, laptops and object storage buckets. Ask who can read each location, because a backup is often easier to copy out than the running system is to access.

System requirements

Encrypt backups at rest

Dump archives are plain BSON unless you encrypt them, so the database encryption on the live server does not carry over to the backup file. Encrypt archives before they leave the database host, using keys held in a key management service or vault that the backup operators cannot use to read production data directly. Confirm the encryption method with your security team and test that a restore works with the stored key.

Restrict access to backup storage

Limit read and write access to the backup location to the small group that runs backups and restores, and log every access. Separate the backup write role from the restore role so an account that creates archives cannot also read them freely. Review the access list on a fixed schedule and remove accounts for staff who have changed roles.

Set retention and delete expired copies

Write down how long daily, weekly and monthly backups are kept, and align that period with your message retention settings and legal hold obligations. Automate deletion of archives past their retention date, and check that object storage lifecycle rules and snapshots delete the copies too. A message removed from the workspace can still exist in old backups until those backups expire, so the retention period decides how long that data lingers.

Control restores into lower environments

A restore into a test or development environment copies live users, messages and credentials-related data into a system with weaker controls. Restore only into an isolated network, replace user contact details and integration tokens with masked values where the test does not need them, and disable outbound notifications and webhooks before the restored instance starts. Record who approved each lower-environment restore.

Capture audit and retention settings

The mongodump archive covers database collections but may not capture every control your compliance team relies on, such as tamper-evident audit trails or retention configuration kept by the workspace. Ask your Rocket.Chat contact and your compliance lead which audit and retention records are stored outside the dumped data and back them up with the same protection. Confirm how these records are restored and verified before you rely on them for an investigation.

Rocket.Chat plans

Testing a restore before a Rocket.Chat upgrade

A tested restore is the rollback path for a Rocket.Chat upgrade, and the upgrade itself is routine because of how the project supports its releases. Standard releases receive support for 6 months and LTS releases for 12 months, according to the Rocket.Chat version durability documentation. After end of life, a version gets no security or bug fixes, cloud services such as the push notification gateway stop working, and the official mobile and desktop clients may no longer connect. Staying current is therefore part of operating the workspace, and every upgrade needs a known way back if it fails. Rolling back a Rocket.Chat upgrade is not simply reinstalling the old image, because MongoDB data may already have been changed by the new version's migrations.

Test the restore before production is touched. Take a fresh mongodump of the production database, restore it with mongorestore into an isolated environment that has the same MongoDB topology and the same current Rocket.Chat release, and point that copy at a separate file storage location holding a copy of the uploads. Do not connect this environment to production email, push, or integration endpoints, or disable those integrations in the copy before starting it. Then run the planned upgrade there, record how long each step took in your own environment, and check the result: sign in with a test account through each identity method you use, confirm that channels, direct messages, and recent uploads open, and connect the desktop and mobile clients to the copy. Confirm the MongoDB version and replica set status against the Rocket.Chat system requirements before you start.

Only after the isolated upgrade passes should production change. Keep the restore runbook, the dump that was tested, and the list of checks together, so the same steps can run again if production fails after the window closes. Record which build of Rocket.Chat was tested, because a later patch release may change behavior. If the isolated run fails, the problem is found while production still runs the old version, which is the point of the exercise. Decide in advance who signs off on the result and who can trigger the rollback.

Limits and what to confirm in your environment

A mongodump backup is only as good as the assumptions behind it. The items below are the ones this page cannot settle for you, because they depend on your MongoDB version, data volume, hosting platform and file store. Confirm each one before you write the backup into your runbook.

MongoDB tool version compatibility

The mongodump and mongorestore binaries should match the MongoDB server version you run, and Rocket.Chat 8.x requires MongoDB 8.0 or later as a replica set. Check the MongoDB database tools compatibility notes for your exact server version before you install a client on the backup host. Record the tool version in the backup job output, so a restore engineer knows which binary produced the archive.

Rocket.Chat requirements

Dump size and duration

Dump time and archive size grow with message history, file metadata and the number of collections, and they are not fixed by the product. Measure a full dump on a copy of your production data, then time a restore into a scratch environment. Those two numbers set your backup window, your retention storage budget and whether a nightly job fits before business hours.

Snapshot consistency from your host

Volume or disk snapshots from a cloud provider or hypervisor are only safe for MongoDB if they capture a crash-consistent state, ideally with the database journal and data files in one snapshot. Ask your provider whether snapshots can be taken on a consistent point, whether they span all database volumes, and how a restore is tested. Do not assume a snapshot is a substitute for a logical dump until you have restored one.

File store versioning and replication

Uploads kept in S3, MinIO, GridFS or another store are not captured by mongodump unless they live in MongoDB itself. Find out whether your bucket or file service offers object versioning, cross-region replication or its own snapshots, and whether those settings cover deleted objects. Your restore plan must match the file store's recovery point, or message attachments will point to files that no longer exist.

Paid-plan features that store data elsewhere

Some paid-plan capabilities keep records outside the main database, for example audit trails, exported data or integrations that write to their own stores. Confirm with Rocket.Chat which of the features you enable hold data outside MongoDB, and where that data sits. Include those locations in your backup scope and restore order, or you will restore a workspace that is missing part of its history.

Rocket.Chat pricing

Restore-test ownership and access

Confirm who can run mongorestore, who holds the encryption keys and archive credentials, and where the backup copies are stored and for how long. Backup access should be controlled separately from the production admin role, because a readable dump contains every message. Assign a named owner for the quarterly restore test and for the check before each Rocket.Chat upgrade.

Questions teams ask before backing up Rocket.Chat

What does backing up Rocket.Chat cost, and who pays for it?

Most of the cost is staff time and storage, and it is mostly recurring. Your team pays for the backup job itself, the storage that holds dumps and copies of uploads, the monitoring that proves each run succeeded, and the retention you choose. A partner's fee covers scoped work such as designing the backup set, writing the runbook and running the first restore test, and it is one-time unless you add an ongoing retainer. Storage cost rises with message volume, file uploads and how many days of backups you keep. Ask any quote to separate design, build, and recurring operation, and to state which storage locations and retention periods it assumes.

How long does a Rocket.Chat restore test take?

The duration depends on the data, not on the mongodump command alone. The main drivers are the size of the MongoDB database, the size of the uploads held in GridFS, S3, MinIO or the file system, the network path between the backup location and the restore host, and whether you restore into a three-member replica set or a single test node. Time also goes to preparing a matching Rocket.Chat version, checking that the restored instance starts and that users can sign in, and recording the result. Measure the duration on a copy of your own data, because no general figure applies to every workspace.

Can an internal team back up and restore Rocket.Chat alone?

Yes, if the team has MongoDB administration skills, access to the database and file store, and a place to run a restore that does not touch production. The hard parts are less the commands than knowing the restore order, handling replica set configuration, and confirming that the Rocket.Chat version in the test matches the backup. Teams without a MongoDB operator often find this is where gaps appear. A partner can scope a design review, a runbook and a supervised restore test, while your staff run the routine jobs. Decide which skills are in-house before choosing the split.

What access does the backup work need from our team?

The work needs read access to the MongoDB deployment with a role that can run mongodump, and write access to the restore target for the test. It also needs the credentials for the file store that holds uploads, such as the S3 or MinIO keys, GridFS access, or the file system path. A separate test environment is required, with its own network, Rocket.Chat instance and database, so the restore never writes over production. You also need the current Rocket.Chat version, its environment settings and the secret used for encryption, because a restore without them can fail or leave data unreadable.

How often should we test a Rocket.Chat restore?

Test a restore on a schedule and always before a major upgrade. A scheduled test confirms that backups are complete and that the runbook still works after changes to the database, storage or Rocket.Chat version. Before an upgrade, a restore into a test environment at the target version shows whether the data and configuration come back cleanly, which gives you a fallback. Record each test with the date, the backup used, the duration and any fixes. The right interval depends on how often data and versions change in your environment, so set it in your risk assessment and confirm it with your compliance team.

Do we need to back up uploads as well as the database?

Yes. A mongodump captures messages, users and settings, but files stored outside MongoDB, such as in S3, MinIO, Google Cloud Storage, WebDAV or the file system, are not included. If the database is restored without matching files, users will see messages that point to missing attachments. Check which storage option your workspace uses, then back up that store on its own schedule and keep it in step with the database backups. Confirm the storage provider's own snapshot and versioning features with your vendor before relying on them.

Which Rocket.Chat versions must we check before restoring?

Restore only to the version that matches the backup or to a later supported version that your upgrade plan covers. Rocket.Chat standard releases are supported for 6 months and LTS releases for 12 months, and an unsupported version stops receiving security fixes and may lose connection to the official mobile and desktop clients. Check the version durability documentation before you choose a target, and confirm MongoDB version requirements for your Rocket.Chat line, because Rocket.Chat 8.x requires MongoDB 8.0 or later as a replica set.

How the database and file backups fit together

Rocket.Chat instances write messages and settings to the MongoDB replica set and uploads to the file store, which may be GridFS, object storage or a file system. Backup jobs run mongodump against the database and copy the file store separately, and both land in a protected backup location. The restore path runs in an isolated test environment first, so you can confirm the database and files still match before any production upgrade.

Database and file backups flow to a protected location, then restore into a test environment first.

How DeployOpen scopes backup and restore work

DeployOpen starts backup and restore work by mapping your Rocket.Chat topology before choosing any tool. The first questions are whether MongoDB runs as a standalone server or as a replica set, where uploads live (GridFS, S3, MinIO, or the file system), which Rocket.Chat release is running, and how long backups must be kept. Those answers decide whether a mongodump snapshot is enough on its own or whether it must be paired with a separate copy of the file store, and they decide where backup jobs run so they do not compete with the live workload. Confirm with your database and storage owners which backup placement and retention rules already apply to your organization, because the design has to fit them rather than replace them.

The build phase produces a written procedure that an engineer who did not design it can follow. It covers the mongodump and mongorestore commands for your database layout, the order in which the database and the uploads are restored, the configuration values that must match between the backup and the target environment, and the checks that show a restore is complete. The same procedure is then rehearsed with your team on a non-production copy, and the restore test is treated as the acceptance point. DeployOpen runs that test with your staff, records what was restored and what was missing, and fixes the gaps before the procedure is handed over. Every engagement is fixed scope: the topology, storage types, deliverables, and timeline are agreed in a written statement of work before work starts, and a quote follows from that scope. Ongoing support, including rehearsing restores before each Rocket.Chat upgrade, is available as a retainer.

How DeployOpen delivers Rocket.Chat backup and restore

DeployOpen scopes, builds and documents the backup and restore setup for your self-hosted Rocket.Chat, inside your own infrastructure. The work covers the MongoDB dump routine, the separate handling of uploads stored outside the database, and a restore test you run before any upgrade.

How we scope

  • Written scope lists your MongoDB topology, standalone or replica set, and which Rocket.Chat instances share it.
  • Scope records where uploads live, such as GridFS, S3, MinIO or the file system, and how each store is captured.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before any backup work starts.

How we build

  • Dump jobs are configured with mongodump for your topology, with retention, storage location and access control set for your environment.
  • Upload backups are built alongside the database dump so files and records stay matched to the same point in time.
  • A restore runbook is written and a test restore is run into a separate environment before any upgrade is attempted.

How we hand over

  • You receive the backup configuration, schedules, restore order and a step-by-step runbook for your own operators.
  • Restore test results are documented, including what was restored, how long steps took and what needed manual correction.
  • Your team is walked through a restore so they can run it without DeployOpen present.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, including periodic restore tests.
  • Backup jobs and retention are reviewed when you change Rocket.Chat versions, MongoDB topology or file storage.
  • Confirm with DeployOpen how backup monitoring alerts and after-hours response are covered before signing the scope.

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.