Backing up collections using snapshots
Snapshots are point-in-time backups of your Amazon OpenSearch Serverless collections that provide disaster recovery capabilities. OpenSearch Serverless automatically creates and manages snapshots of your collections, ensuring business continuity and data protection. Each snapshot contains index metadata (settings and mappings for your indexes), cluster metadata (index templates and aliases), and index data (all documents and data stored in your indexes).
OpenSearch Serverless provides automatic hourly backups with no manual configuration, zero maintenance overhead, no additional storage costs, quick recovery from accidental data loss, and the ability to restore specific indexes from a snapshot.
Before working with snapshots, understand these important considerations. Creating a snapshot takes time to complete and isn't instantaneous. New documents or updates during snapshot creation will not be included in the snapshot. You can restore snapshots only to their original collection and not to a new one. When restored, indexes receive new UUIDs that differ from their original versions. You can run only one restore operation at a time, and you can't start multiple restore operations on the same collection simultaneously. Attempting to restore indexes during an active restore operation causes the operation to fail. During a restore operation, your requests to the indexes fail.
Required permissions
To work with snapshots, configure the following permissions in your data access policy. For more information about data access policies, see Data access policies versus IAM policies.
| Data Access Policy | APIs |
|---|---|
| aoss:DescribeSnapshot | GET /_cat/snapshots/aoss-automated GET _snapshot/aoss-automated/snapshot/ |
| aoss:RestoreSnapshot | POST /_snapshot/aoss-automated/snapshot/_restore |
| aoss:DescribeCollectionItems | GET /_cat/recovery |
You can configure policies using the following Amazon CLI commands:
Here is a sample CLI command for creating an access policy. In the command, replace the
example content with your specific information.
aws opensearchserverless create-access-policy \ --type data \ --nameExample-data-access-policy\ --regionaws-region\ --policy '[ { "Rules": [ { "Resource": [ "collection/Example-collection" ], "Permission": [ "aoss:DescribeSnapshot", "aoss:RestoreSnapshot", "aoss:DescribeCollectionItems" ], "ResourceType": "collection" } ], "Principal": [ "arn:aws-cn:iam::111122223333:user/UserName" ], "Description": "Data policy to support snapshot operations." } ]'
Working with snapshots
By default, when you create a new collection, OpenSearch Serverless automatically creates snapshots every hour. You don't need to take any action. Each snapshot includes all indexes in the collection. After OpenSearch Serverless creates snapshots, you can list them and review the details of the snapshot using the following procedures.
List snapshots
Use the following procedures to list all snapshots in a collection and review their details.
Get snapshot details
Use the following procedures to retrieve detailed information about a specific snapshot.
The snapshot response includes several key fields: id provides a unique
identifier for the snapshot operation, status returns the current state
SUCCESS or IN_PROGRESS, duration indicates the time
taken to complete the snapshot operation, and indexes returns the number of
indexes included in the snapshot.
Restoring from a snapshot
Restoring from a snapshot recovers data from a previously taken backup. This process is crucial for disaster recovery and data management in OpenSearch Serverless. Before restoring, understand that restored indexes will have different UUIDs than their original versions, snapshots can only be restored to their original collection (cross-collection restoration is not supported), and restore operations will impact cluster performance so plan accordingly.
Use the following procedures to restore backed up indexes from a snapshot.
Note
When restoring a snapshot with a command that includes a request body, you can use
several parameters to control the restore behavior. The indexes parameter
specifies which indexes to restore and supports wildcard patterns. Set
ignore_unavailable to continue the restore operation even if an index in the
snapshot is missing. Use include_global_state to determine whether to restore
the cluster state, and include_aliases to control whether to restore associated
aliases. The rename_pattern and rename_replacement parameters
rename indexes during the restore operation.