Backup and Restore S3 Buckets
Table of Contents
- Scheduled Protection Policy for AWS S3 buckets with Elastio
- Backup S3 buckets in foreground mode Elastio CLI
- Backup S3 buckets in Elastio CLI
- Restore S3 bucket in Elastio CLI
This page contains instructions on how to backup and restore AWS S3 buckets using Elastio CLI. You can either run these jobs in foreground mode on the machine where the CLI is running, or in background. To run background jobs a special IAM policy should be created beforehand.
Elastio has introduced an option to create a Protection Policy for the S3 assets specifically. This feature is in preview mode, and can be enabled for your Tenant upon request. S3 Protection Policy gives the advantage of scheduled automated protection of the specified buckets, selected paths within buckets, as well as object selected by prefixes or globs.
For instructions on how to create an S3 Protection Policy, please visit Policies.
Run the following command to backup S3 in foreground:
elastio s3 backup --bucket <bucket-name> --foreground
Run the following command to restore AWS S3 bucket in foreground mode in Elastio CLI:
elastio s3 restore --rp <recovery-point-id> --target-bucket <target-bucket-name> --foreground
To start an S3 backup as a background job with monitoring on run the following command:
elastio s3 backup --bucket <bucket-name> --monitor
To run an S3 backup as a background job without monitoring use the following command:
elastio s3 backup --bucket <bucket-name>
To restore S3 buckets via Elastio CLI you’ll need to provide the IAM role ARN of the role that has right to write to target bucket and the recovery point ID.
Create an IAM policy to restore S3:
elastio s3 generate-restore-iam-policy
The command to restore S3 bucket is as follows:
elastio s3 restore --role-arn <iam-role-arn> --rp <recovery-point-id>