Home > Software engineering >  DynamoDB backup
DynamoDB backup

Time:01-06

I am looking into how I can backup DynamoDB using a Lambda function. My goal is to:

  1. Backup a database.
  2. Store the backup in an other account.

I've managed to do the first using boto3 and the create_backup() call. The second part is where I am stuck at. I cannot find a way to download the backup and store it elsewhere.

I've also looked into export_table_to_point_in_time() but these exports cannot be used to restore a table from what I see.

Is it possible in any way to create a backup from a table and store it in a different account, preferably using a Lambda function?

CodePudding user response:

Use the Restore a backup

CodePudding user response:

To Export

Go to “Exports and streams” tab in the DynamoDB table page

Click on “Export to S3” button

Select the S3 bucket where you want to export

You have two choices here.

  1. You can choose the different AWS account while selecting the S3 bucket and give permissions according to that enter image description here
  2. You can export to an S3 bucket present in the current account and enable CRR (Cross Region Replication) to replicate the objects to another account

To Restore

Choose backups section in DynamoDB console

In the list of backups, choose the backup and click Restore

Enter the new table name to restore

You can also exclude secondary indexes from being created on the new restored table. In addition, you can specify a different encryption mode.

  •  Tags:  
  • Related