Atlas Online Archive moves infrequently accessed documents from an Atlas cluster to lower-cost cloud object storage. The archived data remains queryable without restoration, making archiving useful for historical analysis and retention needs. It is available for M10 and higher clusters. It is not a backup: keep a separate backup strategy for recovery from data loss or corruption. section 17.0 section 17.5
Table 17.1 Atlas archiving criteria
Compare the available rules before creating an archive: standard collections support date-based rules or a custom query; time-series collections use a time field and retention interval. Both offer archive-only and combined query instances. section 17.1
An archiving job selects documents using the configured rule, copies them to object storage, then deletes them from the live cluster. Documents can briefly appear in both places during that transition. Archived data is read-only and is not synchronized with later changes to the cluster. Index date fields and expressions used by archiving queries; insufficient indexing triggers a warning. section 17.1.1 section 17.1.2
Check the operational costs before enabling an archive:
- Archiving consumes cluster resources, including IOPS. A job writes at most 2 GB and processes up to 10,000 partitions; the next job starts five minutes after the current one completes. Check spare cluster capacity first. section 17.1.1
- Federated and archive-only queries incur costs from scans, partition access and transfers. Set data-processing limits to halt new queries at a threshold, or enable termination of queries that exceed it. section 17.3 section 17.5
- Direct writes to the archive and archiving from capped collections are unsupported. You can configure a Deletion Age Limit to remove archived data after a specified period. section 17.1.1 section 17.1.2
Query historical sales
Suppose a date-based rule archives sales whose saleDate is older than five days. In the demonstrated sample_supplies.sales collection, all 5,000 documents meet that rule. Use Connect in the Atlas Online Archive area to obtain a read-only federated connection string for live and archived collections under their existing names, or an archive-only string to query just the historical sales. section 17.3 section 17.1
To restore archived documents, first find the archive ID with `atlas clusters onlineArchive list`, then pause it with `atlas clusters onlineArchive pause` and verify its paused state. Create the required unique index on the destination fields, connect to the archive with `mongosh`, and run an aggregation with `$merge` into the destination Atlas collection. Confirm the destination has enough space; this method is not advised for large, heavily partitioned data sets of approximately 1 TB. section 17.4
