Amazon DynamoDB point-in-time recovery (PITR) provides automatic backups of your DynamoDB table data. This section provides an overview of how the process works in DynamoDB.
After you enable point-in-time recovery, you can restore to any point time within EarliestRestorableDateTime and LatestRestorableDateTime. LatestRestorableDateTime is typically 5 minutes before the current time.
Note The point-in-time recovery process always restores to a new table.
Window time to recover the table For EarliestRestorableDateTime, you can restore your table to any point in time during the last 35 days. The retention period is a fixed 35 days (five calendar weeks) and can't be modified. Any number of users can execute up to four concurrent restores (any type of restore) in a given account.
Along with data, the following are also included on the new restored table using point in time recovery:
- Global secondary indexes (GSIs)
- Local secondary indexes (LSIs)
- Provisioned read and write capacity
- Encryption settings
aws dynamodb describe-table --table-name ecom-seb-6 --query "Table"
Restoring a Table to a Point in Time (AWS CLI)
This procedure assumes that you have enabled point-in-time recovery. To enable it
aws dynamodb update-continuous-backups \
--table-name ecom-seb-6 \
--point-in-time-recovery-specification PointInTimeRecoveryEnabled=True
Confirm that point-in-time recovery is enabled for the MusicCollection table by using the describe-continuous-backups command.
aws dynamodb describe-continuous-backups --table-name ecom-seb-6
Continuous backups (automatically enabled on table creation) and point-in-time recovery are enabled.
{
"ContinuousBackupsDescription": {
"PointInTimeRecoveryDescription": {
"PointInTimeRecoveryStatus": "ENABLED",
"EarliestRestorableDateTime": 1533048385.0,
"LatestRestorableDateTime": 1533049252.282
},
"ContinuousBackupsStatus": "ENABLED"
}
}
Restore the table to a point in time
aws dynamodb restore-table-to-point-in-time \
--source-table-name ecom-seb-6 \
--target-table-name ecom-seb-6-minutes-ago
--use-latest-restorable-time
You can also restore to a specific point in time. Specifying the --no-use-latest-restorable-time argument is optional when restoring to a specific point in time.
aws dynamodb restore-table-to-point-in-time \
--source-table-name ecom-seb-6 \
--target-table-name ecom-seb-6-minutes-ago
--no-use-latest-restorable-time \
--restore-date-time 1519257118.0
aws dynamodb describe-table --table-name ecom-seb-6-minutes-ago
Post restoring setting
After restoring a table, you must manually set up the following on the restored table:
Auto scaling policies
- AWS Identity and Access Management (IAM) policies
- Amazon CloudWatch metrics and alarms
- Tags
- Stream settings
- Time to Live (TTL) settings
- Point-in-time recovery settings
Important
While a restore is in progress, don't modify or delete the AWS Identity and Access Management (IAM)
Pricing for continuous backup
Continuous backups and point-in-time recovery Point-in-time recovery (PITR) provides continuous backups of your DynamoDB table data. You can enable PITR with a single click from the AWS Management Console or a single API call. When enabled, DynamoDB maintains continuous backups of your table for the preceding 35 days.
PITR is charged based on the current size of each DynamoDB table (table data, local secondary indexes) where it is enabled. AWS will continue to bill you until you disable PITR on each table.
Region ireland: $0.22 per GB-month