atlas backups restores start
Start a restore job for your project and cluster.
If you create an automated or pointInTime restore job, Atlas removes all existing data on the target cluster prior to the restore.
To use this command, you must authenticate with a user account or an API key with the Project Owner role. Atlas supports this command only for M10+ clusters.
Syntax
Command Syntax
atlas backups restores start <automated|download|pointInTime> [options]
Arguments
Name | Type | Required | Description |
---|---|---|---|
automated|download|pointInTime | string | true | Type of restore job to create. Valid values include: automated, download, pointInTime. To learn more about types of restore jobs, see https://www.mongodb.com/docs/atlas/backup-restore-cluster/. |
Options
Name | Type | Required | Description |
---|---|---|---|
--clusterName | string | true | Name of the cluster. To learn more, see https://dochub.mongodb.org/core/create-cluster-api. |
-h, --help | false | help for start | |
--oplogInc | int | false | 32-bit incrementing ordinal that represents operations within a given second. When paired with oplogTs, they represent the point in time to which your data will be restored. |
--oplogTs | int | false | Oplog timestamp given as a timestamp in the number of seconds that have elapsed since the UNIX Epoch. When paired with oplogInc, they represent the point in time to which your data will be restored. |
-o, --output | string | false | Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option. |
--pointInTimeUTCSeconds | int | false | Timestamp in the number of seconds that have elapsed since the UNIX epoch that represents the point in time to which your data will be restored. This timestamp must be within the last 24 hours of the current time. |
--projectId | string | false | Hexadecimal string that identifies the project to use. This option overrides the settings in the configuration file or environment variable. |
--snapshotId | string | false | Unique identifier of the snapshot to restore. You must specify a snapshotId for automated restores. |
--targetClusterName | string | false | Name of the target cluster. For use only with automated restore jobs. You must specify a targetClusterName for automated restores. |
--targetProjectId | string | false | Unique identifier of the project that contains the destination cluster for the restore job. You must specify a targetProjectId for automated restores. |
Inherited Options
Name | Type | Required | Description |
---|---|---|---|
-P, --profile | string | false | Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. |
Output
If the command succeeds, the CLI returns output similar to the following sample. Values in brackets represent your values.
Restore job '<Id>' successfully started
Examples
# Create an automated restore: atlas backup restore start automated \ --clusterName myDemo \ --snapshotId 5e7e00128f8ce03996a47179 \ --targetClusterName myDemo2 \ --targetProjectId 1a2345b67c8e9a12f3456de7
# Create a point-in-time restore: atlas backup restore start pointInTime \ --clusterName myDemo \ --pointInTimeUTCSeconds 1588523147 \ --targetClusterName myDemo2 \ --targetProjectId 1a2345b67c8e9a12f3456de7
# Create a download restore: atlas backup restore start download \ --clusterName myDemo \ --snapshotId 5e7e00128f8ce03996a47179