Docs Menu

Docs HomeLaunch & Manage MongoDBMongoDB Atlas

Export Cloud Backup Snapshot

On this page

  • How Atlas Exports Snapshots
  • Exported Data Format
  • Limitations
  • Required Access
  • Prerequisites
  • Export Management

Note

This feature is not available for M0 free clusters, M2, and M5 clusters. To learn more about which features are unavailable, see Atlas M0 (Free Cluster), M2, and M5 Limits.

Atlas lets you export your Cloud Backup snapshots to an AWS S3 bucket.

To learn how to manage automated backup policies and schedules, see Manage Backup Policies.

You can manually export individual snapshots or set up an export policy for automatic export of your snapshots. For automatic exports, you must specify a frequency in your export policy:

  • Daily

  • Weekly

  • Monthly

  • Yearly

Atlas automatically exports any backup snapshot with the frequency type that matches the export frequency. The exported result is a full backup of that snapshot.

Example

Consider the following:

  • A backup policy that sets a weekly and monthly snapshot schedule

  • An export policy that sets a monthly export frequency

Suppose, at the end of the month, the weekly and monthly snapshots happen on the same day. There would be 4 snapshots of which 3 would be weekly snapshots and the fourth snapshot, although treated as a weekly snapshot by Atlas, would also be the monthly snapshot because it happened on the same day. Atlas will export the monthly snapshot only because the export frequency matches the snapshot frequency for that snapshot. To export the weekly snapshots as well, update the export policy to export weekly snapshots also. If the export frequency is set to weekly, Atlas would export all 4 snapshots.

Atlas exports snapshots for collections one at a time. As the export progresses, you may see partial results in your S3 bucket. Atlas queues any new job if Atlas is currently exporting 5 or more replica sets. For sharded clusters, Atlas always exports the snapshots of all the shards simultaneously, regardless of the number of shards.

Atlas charges $.125 per GB of data exported to the AWS S3 bucket, in addition to the data transfer cost incurred from AWS itself. Atlas compresses the data before exporting. To estimate the amount of data being exported, add up the dataSize of each database in your cluster. This total should correspond to the uncompressed size of your export, which would be the maximum cost incurred from Atlas for the data export operation.

Atlas uploads an empty file to /exported_snapshots/.permissioncheck when you:

  • Add a new AWS S3 export bucket

  • Start an export

After Atlas finishes exporting, Atlas uploads a metadata file named .complete and a metadata file named metadata.json for each collection.

If an export job fails:

  • Atlas doesn't automatically try to export again.

  • Atlas doesn't remove any partial data in your S3 bucket.

Atlas uploads the contents of your database to S3 in .json.gz format with documents in extended JSON format within. The path to the files on S3 is:

/exported_snapshots/<orgName>/<projectName>/<clusterName>/<initiationDateOfSnapshot>/<timestamp>/<dbName>/<collectionName>/<shardName>.<increment>.json.gz

Where:

<orgName>
Name of your Atlas organization.
<projectName>
Name of your Atlas project.
<clusterName>
Name of your Atlas cluster.
<initiationDateOfSnapshot>
Date when snapshot was taken.
<timestamp>
Timestamp when the export job was created.
<dbName>
Name of the database in the Atlas cluster.
<collectionName>
Name of the Atlas collection.
<shardName>
Name of the replica set.
<increment>
Count that is incremented as chunks are uploaded. Starts at 0.

The following limitations apply:

Important

When you export snapshots from a sharded cluster to S3 buckets, the export from each shard might have a different timestamp. This can result in duplicate or inconsistent data across the shards.

To manage your Cloud Backup snapshots, you must have Project Owner access to the project. Users with Organization Owner access must add themselves as a Project Owner to the project before they can manage Cloud Backup snapshots.

To export your Cloud Backup snapshots to an AWS S3 bucket, you will need the following:

  1. M10 or higher Atlas cluster with Cloud Backup enabled.

  2. AWS IAM role with STS:AssumeRole that grants Atlas access to your AWS resources. To learn more about configuring AWS access for Atlas, see Set Up Unified AWS Access.

  3. AWS IAM role policy that grants Atlas write access or the S3:PutObject and S3:GetBucketLocation permissions to your AWS resources. To learn more about configuring write access to AWS resources, see Set Up Unified AWS Access.

    Example

    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Action": "s3:GetBucketLocation",
    "Resource": "arn:aws:s3:::bucket-name"
    },
    {
    "Effect": "Allow",
    "Action": "s3:PutObject",
    "Resource": "arn:aws:s3:::bucket-name/*"
    }
    ]
    }
← Storage Engine and Cloud Backup Encryption