Backup and Restore in Aurora

Learn via video courses
Topics Covered

Overview

Amazon Aurora is a MySQL and PostgreSQL-compatible relational database engine that combines the speed and availability of high-end commercial databases with the simplicity and cost-effectiveness of databases.

One of the key features of Aurora is its ability to automatically create backups of your database, which can be used to restore your data in case of data loss or corruption. As a result, Aurora can generate backups quickly and effectively without affecting your database's performance.

Introduction to Amazon Aurora Backup Storage Usage

Backups in AWS Aurora are automatic within a specified/default backup window. Aurora backups are stored in AWS Simple Storage Service (S3). The backups are continuous and incremental, and they cannot be disabled.

Additionally, backups also have a retention period defined which allows backups to be stored for a specific period. The backup retention period is set to one day by default, but this can be changed when creating or modifying the database. The backup retention period could be from 1 to 35 days.

To save on the costs of backup storage, the retention period could be used to automatically delete the old backups and delete the manual snapshots which are no longer needed.

introduction-to-amazon-aurora

Creating a DB Cluster Snapshot

Here are the steps for creating a snapshot using the Amazon RDS console:

  1. Open the AWS RDS Console.
  2. Select Databases from the navigation pane.
  3. Select a writer instance for the DB cluster from the list of DB instances. Choose Actions, then Take a snapshot.
  4. Enter the name of the DB cluster snapshot in the Snapshot name box.
  5. Select Take Snapshot.

Restoring from a DB Cluster Snapshot

The following are the steps for restoring a DB cluster from a DB cluster snapshot.

  1. Sign in to the AWS Management Console and navigate to AWS RDS Console.
  2. In the navigation pane, choose Snapshots.
  3. Choose the DB cluster snapshot that you want to restore from.
  4. Choose Restore snapshot from the Actions menu.
  5. Enter the name of your restored DB cluster in the DB instance identifier field on the Restore snapshot page.
  6. Select Restore DB instance.

Copying a DB Cluster Snapshot

Here's how to copy a DB cluster snapshot.

  1. Sign in to the AWS Management Console and navigate to AWS RDS Console.
  2. Select Snapshots from the navigation pane.
  3. Check the box next to the DB cluster snapshot you want to copy.
  4. Select Copy Snapshot from the Actions menu.
  5. In New DB Snapshot Identifier, enter the name of the DB cluster snapshot copy.
  6. Choose Copy Snapshot.

Sharing a DB Cluster Snapshot

Here are the steps to share a manual DB cluster snapshot by using the Amazon RDS console.

  1. Sign in to the AWS Management Console and navigate to AWS RDS Console.
  2. Select Snapshots from the navigation pane.
  3. Choose the manual snapshot you want to share.
  4. For Actions, choose Share snapshot.
  5. Choose one of the options for DB snapshot visibility.
  6. Add the AWS account ID that you want to allow to restore a DB cluster from your manual snapshot, and then click on Add.
  7. Click Save to save the changes.

Exporting DB Cluster Data to Amazon S3

The following are the steps for exporting DB cluster data to AWS S3:

  1. Sign in to the AWS Management Console and navigate to AWS RDS Console.
  2. Select Databases from the navigation pane.
  3. Select the DB cluster from which you want to export data.
  4. Select Export to Amazon S3 from the Actions menu.
  5. Enter a name for the export task in the Export identifier field.
  6. Select All to export all data in the database cluster.
  7. For the S3 bucket, choose the bucket to export to.
  8. Choose an IAM role that grants you write access to your desired S3 bucket, or create a new role.
  9. Enter the ARN for the key to use for encrypting the exported data in the KMS key field.
  10. Select Export to Amazon S3.

Exporting DB Cluster Snapshot Data to Amazon S3

To export a DB snapshot to AWS S3, follow these steps:

  1. Sign in to the AWS Management Console and navigate to AWS RDS Console.
  2. Select Snapshots from the navigation pane. Select the type of snapshot you want to export from the tabs.
  3. Select the snapshot you want to export from the list of snapshots. Select Export to Amazon S3 from the Actions menu.
  4. Enter a name for the export task in the Export identifier field. This value is also used to create the file name in the S3 bucket.
  5. Select All to export all data from the snapshot. Select the S3 bucket to which you want to export.
  6. Choose a role for the IAM role.
  7. Enter the ARN for the key to use for encrypting the exported data in the AWS KMS key field.
  8. Select Export to Amazon S3.

Restoring a DB Cluster to a Specified Time

Here are the steps to restore a database cluster to a specific point in time.

  1. Sign in to the AWS Management Console and navigate to AWS RDS Console.
  2. Select Databases from the navigation pane.
  3. Select the DB cluster you want to restore.
  4. Choose to Restore to point in time from the Actions menu.
  5. Choose the Latest restorable time to restore to the most recent possible time, or Custom to select a time.
  6. Enter the name of the target restored DB cluster as the DB instance identifier. The name must be distinct.
  7. Select Restore to a point in time.

Deleting a DB Cluster Snapshot

Below are the steps to delete a DB cluster snapshot.

  1. Sign in to the AWS Management Console and navigate to AWS RDS Console.
  2. Select Snapshots from the navigation pane.
  3. Select the DB cluster snapshot to be deleted.
  4. Select the Delete snapshot from the Actions menu.
  5. On the confirmation page, select Delete.

Conclusion

  • Amazon Aurora is a relational database engine that supports MySQL and PostgreSQL and combines the speed and availability of high-end commercial databases with the simplicity and cost-effectiveness of databases.
  • Aurora is designed to be highly available, with multiple copies of your data and automatic failover to ensure that your database remains operational even if a server fails.
  • Aurora automatically creates and stores a snapshot of your database in Amazon S3. Because these snapshots are stored incrementally, only the changes made to your database since the previous snapshot are saved.
  • Aurora provides several options for restoring your database from a backup. You can return your database to its original state.
  • Aurora also allows you to create manual snapshots of your DB cluster, which can be useful for creating a snapshot of your database at a specific point in time or a snapshot that can be shared with another AWS account.
  • In terms of storage, Aurora manages the storage space used by your backups automatically. This means that as your database grows and changes over time, Aurora will add and delete snapshots.