Backup search
Overview
With AWS Backup, you can create backups, also known as recovery points, of AWS resources. You can search for backups of certain resource types such as Amazon S3 and Amazon EBS, as well as items and files within those backups using the AWS Backup console or the command line.
AWS Backup offers the ability for you to search the metadata of your backups of supported resource types at a granular level for files or objects that match the properties you define in your search, such as size, creation date, and resource type. You can dive even deeper by defining the properties of the items you want to locate.
First, create a backup index you want to be able to include in a future search. Backup index creation can be automated through a backup plan or you can manually create one for any existing recovery point. When you’re ready to search, set the backup and item properties you want to see in the search results. Optionally, you can restore the backup or item you sought in the search.
This document outlines the steps to create a backup index, search indexed backups, restore from your search results, and troubleshoot any issues with the index and search functions in AWS Backup.
Use cases for backup indexes and search
You may be an administrator who wants to recover a specific file or object. Instead of manually identifying or guessing which backups contain the data, you can search the metadata of your recovery points and restore the exact backup, files, or objects you need.
Restoring a full backup just to find the specific item that might be in it can take hours or days. Instead, with a backup search, you can find and restore just the specific file or object you require.
Backup searches are useful for backup administrators, backup operators, data owners, and other IT professionals who interact with data backup, restore, and compliance.
Access
Before you create an index and a search, your account must have required permissions for the operations.
Required permissions for index and search creation and management include:
-
backup:ListIndexedRecoveryPointsForSearch
-
backup:SearchRecoveryPoint
These permissions can be found in the
policies AWSBackupServiceRolePolicyForItemRestores
and AWSBackupServiceRolePolicyForIndexing
.
If you choose to encrypt search results with a customer-owned AWS KMS key, the following permission is required:
-
kms:GenerateDataKey
See IAM roles in the IAM User Guide for information on how to use roles and permissions.
Process Flow
A backup search involves three steps, plus an optional fourth restore step for when you want to restore the items returned in your search.
Index your backups: Enable indexing in your backup plan(s) or manually create a backup index through the console or CLI for each existing backup (recovery point) you want to be eligible for searches.
Search backup metadata for a recovery point, file or, object:
Specify the properties of the backups and items you want to find in your search, such as
your searching your S3 buckets created between April 2 and 6. with tags of
Administration
and for objects greater than 100 MB with the key name
containing Admin
.
Review search results: If you find the recovery point or item you were seeking, you have the option to restore it. If you haven’t found the recovery point or item, you can refine the backup properties and item properties, then initiate a new search.
Restore specific items (optional): Specify file paths or items to restore, as well as the restore conditions.
Backup indexes
To be searchable, a backup (recovery point) must first have a corresponding index.
Backup index creation can be enabled in a backup plan so that each future backup will also have an associated backup index. You can also create an index as you create an on-demand backup.
Alternatively, you can retroactively create an index for an existing recovery point, either from the Vault recovery point detail screen in the AWS Backup console or through AWS CLI.
Recovery points of supported resource types can have a backup index if they are stored in a standard backup vault (recovery points in a logical air-gapped vault do not currently support backup indexes).
S3 backup indexes
An S3 backup can be periodic, where it is scheduled at a fixed interval according to your backup plan. Each time a periodic backup is created, a backup index is created for it. An S3 backup can also be continuous, where each change in the backup is logged. Since there can be numerous changes daily, only one backup index is created daily for a continuous backup.
The first backup index that is created for a continuous S3 recovery point is full; subsequent indexes for the same recovery point may be incremental.
EBS backup indexes
Each backup index created for an EBS recovery point is full (not incremental).
AWS Backup attempts to automatically repair snapshot issues during the creation of a backup index. If a file system was in a dirty state when the recovery point was created, AWS Backup will automatically attempt to recovery the file system. If this recovery fails, the index creation job will also fail.
The nature of the snapshot determines if it can be indexed:
Can be indexed:
File systems: ext2, ext3, ext4, vfat, xfs, and ntfs
Cannot be indexed:
Snapshots in archive tier (cold storage)
RAID and other multi disk storage options
Symbolic links
Hard links
Backup index creation steps
Searches
Once you have one or more backups with an index, you can search those indexed backups through the AWS Backup console or through AWS CLI.
As you create a search, you’ll select one resource type. The results will only return recovery points containing that type, such as S3 buckets or EBS snapshots.
You then specify the properties of the backups (recovery points) you wish to include in the search. You can specify up to 9 properties. Property types included more than once will return results that match all included values.
Specify the properties of the items you wish to find within the returned recovery points, such as bucket name or file size. Narrow your results by including multiple properties.
If one value for an item property is included when you create a search through the AWS Backup console, the results will return only items that match that item property (AND logic). If you repeat the same item property, but with different values, the results will return all items that match any of the included values (OR logic). For example, if you include two EBS file paths, all items of recovery points that are included in the search that match either file path will be in the search results.
-
S3 item properties include creation time, Etags, object key, object size, and version ID.
-
EBS item properties you can use to help filter your search include creation time, file path, last modification time, and size.
Optionally, you can include an AWS KMS key ID to encrypt your results. If a key is not included, AWS Backup will use a service-owned key to encrypt results.
Stop a search
You can stop a search job if is in status RUNNING
.
A search job will continue until it reaches COMPLETED
status (or
FAILED
status if there is an error). You can interrupt a
RUNNING
search job if you wish to end an in-progress search job, which may
be desirable if you have found the backup or item you were seeking before the job
completed.
-
In the AWS Backup console, Select the Stop search job button.
-
In the CLI, send the operation
stop-search-job
with the search job identifier you want to stop.
Search results
Once a search job has begun, it will begin aggregating results even while has an Running
status. While a search job is running and until it completes, partial results are available:
-
In the console, results will display as they are retrieved during the search. Results do not auto-refresh, but you can view the latest results by selecting the refresh button. To view results beyond the first 1,000 items, select Export results.
-
The CLI operations
get-search-job
andlist-search-jobs
will return search job statuses. If the job status isRUNNING
, the operation will return an incomplete list.
Results from a search job are available in the console and through CLI for 7 days once a search is stopped or has completed. During this time, you can export the results to your preferred Amazon S3 bucket so you can access the results past this timeframe.
Each search job contains detailed information, available in the console or through CLI, including which recovery points were searched, the search name and status, its description, its creation and completion date and time, and information about the objects or items returned as well as the number of items and recovery points scanned.
If the results do not contain the recovery point, item, or object you were seeking, you can create a new search with different backup and item properties. Each search is charged individually.
Each resource type has unique considerations for the results the search returns:
-
A search of S3 recovery points will not return delete markers as part of its search result, even if those objects match the search’s specified item properties.
-
Results of an EBS search may have a null value for creation time for file systems in which that field is unsupported. Those file systems may include, but are not limited to, vfat, ext2/3, and versions of XFS prior to v5.
Export search results to an S3 bucket
AWS Backup retains search results for 7 days, starting with the completion time and date. These results are viewable in the AWS Backup console or retrievable through the CLI operation list-search-job-results.
A best practice is to export your search results to an S3 bucket to retain results
beyond the 7 day retention. The export job will create a folder named Export Job
ID
in your designated bucket, then export the results to that folder. Once the
results are exported there, they are available for as long as you retain the bucket.
You can export the search results of any supported resource type, not just an S3 search.
Cost considerations and best practices
Each backup index creation and each search job incurs a charge. Each backup index has a
storage charge. Each restore from search results (as with all other all restore jobs) is
charged. Learn more at AWS Backup pricing
You can narrow the possible returned results of a search job by including multiple backup and item properties; this may result in a lower cost than a search than spans all possible recovery points.
Restore from search
Many customers choose to search through their backups - and the objects or files within them - to find a specific recovery point or items to restore. See Restore a backup by resource type for information on restores in general.
You can restore from your search results in the AWS Backup console by navigating to
Jobs > Search job results > Restore. To restore through AWS CLI, use
start-restore-job
with metadata specific to the resource type,
recovery point, and items involved in the restore.
See Restore S3 data using AWS Backup for information on how to restore a recovery point with S3 data, to restore an S3 bucket, or to restore up to five objects or folders with an S3 bucket.
See Restore an Amazon EBS volume for information about restoring an EBS snapshot to a new volume that attaches to an EC2 instance.