--- title: "Rocket Chat MongoDB Backup and Restore Guide" slug: "mongodb-backup-and-restore" description: "Learn to back up and restore MongoDB for Rocket Chat. Ensure secure messaging, reliable collaboration, and scalable open source deployments with data safety." updated: 2026-05-13T13:36:58Z published: 2026-05-13T16:26:42Z canonical: "docs.rocket.chat/mongodb-backup-and-restore" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # MongoDB Backup and Restore Maintaining backups of your workspace data is a very important practice. These data backups can act as a safety measure where data can be recovered or restored in case of an emergency. Rocket.Chat uses MongoDB as its database. With MongoDB, you have multiple built-in backup options depending on the deployment method. In this guide, we are going to focus on how to: 1. [Perform a backup of your Rocket.Chat workspace data](/v1/docs/mongodb-backup-and-restore#mongodb-backup-with-mongodump) 2. [Restore your Rocket.Chat workspace data](/v1/docs/mongodb-backup-and-restore#mongodb-restore-with-mongorestore) ## MongoDB backup with `mongodump` `mongodump` allows you to create backups from standalone, replica sets or sharded cluster deployments. > [!NOTE] > From MongoDB server 4.4, you need to install the `mongodump` utility separately. Visit the [official documentation](https://www.mongodb.com/docs/database-tools/mongodump) for more details. ### Backup a MongoDB standalone instance To backup a simple MongoDB standalone instance, use: ```bash mongodump ``` - Running `mongodump` without any options assumes the database is running on `localhost` at port `27017` with no authentication. - When the backup completes, a `/dump` directory is created in your current working directory. ### Backup a remote MongoDB instance Backing up a remote MongoDB instance can be done with the following command: ```bash mongodump --uri="mongodb://:" [additional options] ``` You can include additional authentication or configuration options depending on your environment. For the complete list of supported options, refer to the [official documentation](https://www.mongodb.com/docs/database-tools/mongodump/). You should see something like the image below when the command is running: ![](https://cdn.us.document360.io/6ae79a05-7252-45d0-96e8-8f375e07b1b2/Images/Documentation/mongodump command executing.png) mongodump command executing ## MongoDB Restore with `mongorestore` `mongorestore` restores data from a backup created with mongodump. You can restore an entire database, selected collections, or specific BSON dump files into a MongoDB instance. > [!NOTE] > Before restoring, drop any existing database schema that shares the same name as the one you are restoring. Failing to do so may result in data conflicts. - The syntax for the `mongorestore` command is as follows: ```bash mongorestore ``` - To restore from a `dump` directory to a local mongod instance running on port `27017`, run: ```bash mongorestore  dump/ ``` - To restore data to a remote MongoDB deployment, run: ```bash mongorestore --uri="mongodb://:" /dump ``` > [!NOTE] > You can also restore a specific collection or collections from the `dump/` directory. Visit the [official documentation](https://www.mongodb.com/docs/database-tools/mongorestore/) for more details. In a successful command execution, you should see a screen like the one below: ![](https://cdn.us.document360.io/6ae79a05-7252-45d0-96e8-8f375e07b1b2/Images/Documentation/mongorestore command executed.avif) mongorestore command executed > [!NOTE] > As a workspace user, you can also download your personal data on the workspace as HTML or export it as JSON. Refer to [Manage Your Account Settings](/v1/docs/manage-your-account-settings#my-data) for more details.