Atlas lets you restore data from selected databases or collections from Scheduled or On-Demand Snapshots and Continuous Cloud Backups.
Note
This page applies to Atlas Core only. To learn about Atlas Infinite restores, see Restore an Atlas Infinite Cluster.
Considerations
Atlas supports restoring from selected databases or collections captured by a given backup. This restore model enables the following:
Selectively restoring tenants in a multi-tenant database architecture where each database or collection maps to a specific tenant.
Targeted recovery of essential data
Selection of specific collections for analytics
Important
Collection- and Database-Level Restore jobs are not intended to reduce RTO and can take longer than full cluster restore jobs.
Atlas supports two write strategies for Collection- and Database-Level Restore jobs. Choose the one best suited to your use case:
Create as new appends the selected databases or collections to the existing data on the target cluster. If a selected database or collection has the same name as one on the target cluster, Atlas renames them to avoid conflict.
Overwrite existing overwrites all selected databases or collections with matching names that already exist on the target cluster. Any writes you make to these databases or collections during the restore job will be lost.
Restoring selected databases or collections temporarily increases disk usage. Atlas blocks restore jobs from starting if there isn't enough disk space available. Consider scaling up cluster storage before starting a restore job.
If disk auto-scaling is enabled, Atlas scales up storage automatically as needed, then restarts in-progress collection restores.
If disk auto-scaling is disabled, the restore job fails and rolls back if disk usage reaches 95%.
If one or more databases or collections fail to restore during a collection- and database-level restore operation, the entire operation fails.
Limitations
Collection- and Database-Level Restore jobs have the following limitations:
Collection- and Database-Level Restore doesn't restore MongoDB Search indexes. You must manually rebuild MongoDB Search indexes after restore.
Atlas doesn't support restoring individual time-series collections.
Atlas doesn't support restoring individual queryable encryption collections.
Atlas doesn't support views for collection- and database-level restore jobs.
You can't run multiple collection- and database-level restore jobs concurrently. You must wait for a running collection- and database-level restore job to finish before initiating another.
Atlas doesn't support collection- and database-level restore on NVMe clusters.
Atlas doesn't support restoring snapshots from clusters with IP-restricted Encryption at Rest enabled unless you have a private endpoint configured.
During a collection- and database-level restore job, Atlas transfers data over the public Internet even if you have private endpoints configured.
You can't perform collection- and database-level restore with fallback snapshots.
You can specify up to 100 databases and 100 collections per collection- and database-level restore request. Selecting a database restores all its collections without counting them against the 100 collection limit. This limit applies only to namespaces explicitly listed in the request body.
Required Access
To monitor a backup restore job until it completes, you must have Project Read Only access or higher to the specific project.
To start a restore job, you must have Project Backup Recovery Operator, Project Backup Manager, or Project Owner access to the project.
For cross-organization or cross-project restores, the required permissions apply to both the source and target projects. You must have the necessary permissions: Project Backup Manager or Project Owner in both projects to initiate or manage such restore operations.
Procedure
The Atlas Administration API provides endpoints for restoring selected databases or collections from a snapshot.
To list the available databases within a snapshot, use the Return Databases in the One Snapshot endpoint.
To list the available collections within a database, use the Return Collections in One Database in One Snapshot endpoint.
To verify that a specific database exists, use the Return One Database in One Snapshot endpoint.
To verify that a specific collection exists, use the Return One Collection in One Database in One Snapshot endpoint.
To initiate your restore job, use the Create One Collection Restore Job endpoint.
For restore jobs using scheduled or on-demand snapshots, define the
snapshotIdfield.To review all collection- and database-level restore jobs, use the Return All Collection Restore Jobs for One Cluster endpoint.
To review a specific collection- and database-level restore job, use the Return One Collection Restore Job for One Cluster endpoint.
To review the states of all databases or collections targeted for restore, use the Return All Collection States for One Collection Restore Job.
To review the state of a specific database or collection targeted for restore, use the Return One Collection State for One Collection Restore Job.
The Atlas Administration API provides endpoints for restoring selected databases or collections from a snapshot.
To list the available databases within a snapshot, use the Return Databases in the One Snapshot endpoint.
To list the available collections within a database, use the Return Collections in One Database in One Snapshot endpoint.
To verify that a specific database exists, use the Return One Database in One Snapshot endpoint.
To verify that a specific collection exists, use the Return One Collection in One Database in One Snapshot endpoint.
To initiate your restore job, use the Create One Collection Restore Job endpoint.
For restore jobs using continuous cloud backup, specify either:
The
oplogIncandoplogTsfields orThe
pointInTimeUtcSecondsfield.
To review all collection- and database-level restore jobs, use the Return All Collection Restore Jobs for One Cluster endpoint.
To review a specific collection- and database-level restore job, use the Return One Collection Restore Job for One Cluster endpoint.
To review the states of all databases or collections targeted for restore, use the Return All Collection States for One Collection Restore Job.
To review the state of a specific database or collection targeted for restore, use the Return One Collection State for One Collection Restore Job.
In Atlas, go to the Backup details for your project.
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Backup under the Database heading.
The Backup details display.
Click the cluster link.
Select restore type and write strategy.
In the Source Details pane, select Restore database(s)/collection(s).
Under the Write Strategy heading, select the write strategy suitable for your use case. To learn more, see Collection- and Database-Level Restore Considerations.
Select data to restore.
Under the Select Restore Data heading, first choose your preferred entry method.
If you select Checkbox Entry, Atlas displays a list of all databases captured by the snapshot. Each database entry includes a collapsible list of all of its collections to enable collection-level restore.
If you select List Entry, Atlas displays a text entry field in which you provide the names of the databases or collections you want to restore. Enter each name on its own line. Enter databases by their names, enter collections in the database.collection name format.
Click Continue.
Specify the restore target.
In the Destination pane, select the project that hosts the restore target cluster from the Destination Project dropdown.
Select the restore target cluster from the Destination Cluster dropdown.
The source project and cluster of the snapshot appears with the Source label.
If you use the Add as new write strategy and any of your selected databases or collections have the same names as databases or collections already on the destination cluster, Atlas renames these by appending a suffix to each database or collection.
You can also optionally rename databases or collections under the Rename database(s)/collection(s) heading. You can either rename specific databases or collections individually, or batch-rename them by clicking Add a suffix to all source names and entering a suffix into the prompt.
In Atlas, go to the Backup details for your project.
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Backup under the Database heading.
The Backup details display.
Click the cluster link.
Select restore type and write strategy.
In the Source Details pane, select Restore database(s)/collection(s).
Under the Write Strategy heading, select the write strategy suitable for your use case. To learn more, see Collection- and Database-Level Restore Considerations.
Select data to restore.
Under the Select Restore Data heading, first choose your preferred entry method.
If you select Checkbox Entry, Atlas displays a list of all databases captured by the snapshot. Each database entry includes a collapsible list of all of its collections to enable collection-level restore.
If you select List Entry, Atlas displays a text entry field in which you provide the names of the databases or collections you want to restore. Enter each name on its own line. Enter databases by their names, enter collections in the database.collection name format.
Click Continue.
Specify the restore target.
In the Destination pane, select the project that hosts the restore target cluster from the Destination Project dropdown.
Select the restore target cluster from the Destination Cluster dropdown.
The source project and cluster of the PIT backup appears with the Source label.
If you use the Add as new write strategy and any of your selected databases or collections have the same names as databases or collections already on the destination cluster, Atlas renames these by appending a suffix to each database or collection.
You can also optionally rename databases or collections under the Rename database(s)/collection(s) heading. You can either rename specific databases or collections individually, or batch-rename them by clicking Add a suffix to all source names and entering a suffix into the prompt.
Restart your application and ensure it uses the new target cluster.