How To Create And Restore RDS Snapshot

What Is RDS Instance?

Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud.

Where RDS Snapshots Will Be Stored?

Be default, RDS will create and store automated backups securely in S3 Bucket as per the retention period.

Also you can create a manual snapshot of the DB instance which are kept until you explicitly delete it.

What Can You Do With Snapshots?

You can create a new DB instances using the snapshot.

You can migrate RDS instance to another region using the DB snapshots.

Creating A DB Snaphot:

Amazon RDS creates a storage volume snapshot of the DB instance, which back up the entire database not just the single database within.

When you create a DB snapshot you need to identify which DB instance you’re going to backup , and you have to give a unique name to the snapshot for easy identification.

The amount of time for creating DB snapshot depends on the Instance type and the Storage used.

Let’s Login to RDS Console and create your first DB snapshot:

https://ap-southeast-1.console.aws.amazon.com/rds/home?region=ap-southeast-1#

Assuming that you have a running DB instance in place. If you dont have one, create a RDS instance using the below link,

Create RDS Inistance From Console

Create RDS Instance Using Terraform

Once the DB instance is ready, Let jump into creating the snapshot for this DB instance.

Creating A Manual Snapshot:

In the navigation pane, Choose Databases,

In the list of databases, Choose the DB instance from which you want to create a snapshot.

For Actions, choose Take snapshot,

Give a name for the snapshot, Click Take snapshot

It will take you to the Snapshot page, And you can the snapshot creation progress.

Now, You have created your first manual snapshot for the DB instance.

Creating Snapshots Automatically:

Choose the DB instance for which you want to create snapshots automatically.

Choose modify, Scroll down and you should see Backup

Here, We are going to mention a Backup window, So that RDS will take a snapshot for this DB instance automatically at the mentioned time.

Backup retention period : The number of days for which the automated snapshots are retained.

If you set to 0 days, the automated snapshot option will be disabled.

Now , We know how to configure RDS instance to create snapshots automatically.

Restoring From A DB Snapshot:

Assuming that we have a snapshot in place.

Go to Snapshots pane of the RDS console:

https://ap-southeast-1.console.aws.amazon.com/rds/home?region=ap-southeast-1#db-snapshots:

Choose the Snapshot , For Actions , Click Restore snapshot

This will create a new DB instance with the same configuration of the DB instance from which you have created a snapshot.

If required, You can change the DB instance class, VPC security groups , Storage type, Network and Security, But the Data and the DB credentials will remain the same as of the DB instance from which the snapshot was taken.

Give a unique name for the new DB instance

 

Once you have modified the DB configurations If required , Choose Restore DB Snapshot.

Now you should be able to create a new DB instance , with same data and configurations from the existing DB snapshots.

Hope you have liked it, Check out my other blogs related to DEVOPS / AWS.