0
0
DynamodbHow-ToBeginner ยท 3 min read

Enable Point In Time Recovery in DynamoDB: Simple Steps

To enable PointInTimeRecovery in DynamoDB, use the UpdateContinuousBackups API or AWS CLI with PointInTimeRecoverySpecification set to Enabled=true. This activates continuous backups allowing you to restore your table to any second within the last 35 days.
๐Ÿ“

Syntax

Use the UpdateContinuousBackups API to enable Point In Time Recovery on a DynamoDB table.

  • TableName: The name of your DynamoDB table.
  • PointInTimeRecoverySpecification: An object with Enabled set to true to turn on PITR.
bash
aws dynamodb update-continuous-backups --table-name YourTableName --point-in-time-recovery-specification Enabled=true
๐Ÿ’ป

Example

This example shows how to enable Point In Time Recovery on a DynamoDB table named Orders using AWS CLI.

bash
aws dynamodb update-continuous-backups --table-name Orders --point-in-time-recovery-specification Enabled=true
Output
{ "ContinuousBackupsDescription": { "ContinuousBackupsStatus": "ENABLED", "PointInTimeRecoveryDescription": { "PointInTimeRecoveryStatus": "ENABLED" } } }
โš ๏ธ

Common Pitfalls

Common mistakes when enabling PITR include:

  • Using incorrect table name or misspelling it.
  • Not setting Enabled=true in the specification.
  • Trying to enable PITR on a table that is already deleted or in the process of deletion.
  • Assuming PITR backups are instantaneous; it may take a few minutes to activate.

Always verify the status after enabling.

bash
aws dynamodb update-continuous-backups --table-name WrongTableName --point-in-time-recovery-specification Enabled=true

# Correct usage:
aws dynamodb update-continuous-backups --table-name CorrectTableName --point-in-time-recovery-specification Enabled=true
๐Ÿ“Š

Quick Reference

ActionCommand ExampleDescription
Enable PITRaws dynamodb update-continuous-backups --table-name TableName --point-in-time-recovery-specification Enabled=trueTurns on continuous backups for the table.
Check PITR statusaws dynamodb describe-continuous-backups --table-name TableNameShows if PITR is enabled or disabled.
Disable PITRaws dynamodb update-continuous-backups --table-name TableName --point-in-time-recovery-specification Enabled=falseTurns off continuous backups.
โœ…

Key Takeaways

Enable Point In Time Recovery using the UpdateContinuousBackups API or AWS CLI with Enabled=true.
PITR allows restoring your DynamoDB table to any second within the last 35 days.
Verify the table name and PITR status after enabling to avoid errors.
PITR activation may take a few minutes; it is not immediate.
You can disable PITR anytime using the same API with Enabled=false.