Point-in-time Recovery - DynamoDB Backup and Restore
Syntax
aws dynamodb restore-table-to-point-in-time \
--source-table-name <source_table> \
--target-table-name <target_table> \
--restore-date-time <datetime>
Example
aws dynamodb restore-table-to-point-in-time \
--source-table-name my-table \
--target-table-name my-restored-table \
--restore-date-time "2022-02-16T00:00:00.000000Z"
Output
- Restored table
my-restored-table
with data as of2022-02-16T00:00:00.000000Z
Explanation
DynamoDB's point-in-time recovery feature allows you to restore your entire table or individual items to any point in time during the last 35 days. Once you have enabled point-in-time recovery for a table, you can use the restore-table-to-point-in-time command to create a new table with the data as of the specified date and time. The new table will have the same schema and data type settings as the original.
Use
Use point-in-time recovery to:
- Restore lost or deleted data
- Recover from accidental data changes
- Test data at a specific point in time
Important points to consider
- You must have point-in-time recovery enabled for the table you want to restore
- You must specify a date and time within the last 35 days
- You cannot restore to the same table as the source table, you must create a new target table
Summary
DynamoDB's point-in-time recovery feature enables you to restore your table data to any point in time during the last 35 days. Use the restore-table-to-point-in-time
command to create a new table with the data as of the specified date and time. Keep in mind that you must have point-in-time recovery enabled, specify a valid date and time, and create a new target table.