How to take and restore a snapshot on AWS RDS MySQL Instance

Creating a snapshot of the RDS instance makes a complete copy of the entire DB instance and not just the individual database. It creates a storage volume snapshot of the DB instance. The time required to take a snapshot of the RDS instance varies with the size of the databases.

The snapshot that is created can be used to restore the data to a DB instance. The data can not be restored to an existing database instance from the snapshot, rather a new database instance is created when the snapshot is restored. If the DB snapshot is both shared and encrypted, it can not be used to restore to a database instance.

In this article, we will see the steps to create a snapshot of the existing RDS MySql Instance. Then we will see the steps to restore the snapshot which creates a new RDS Instance. At last, we will clean up the instances and snapshots.

This is a manual way to create snapshots of RDS instances. Snapshots are also created and saved automatically in a backup window of the DB instance. Automated backups take place when the DB instance is in the "Available" state.

Pre-requisites

  1. AWS Account (Create if you don’t have one).
  2. At least one RDS MySql Instance.

What will we do?

  1. Login to AWS.
  2. Create a snapshot.
  3. Restore the snapshot.
  4. Delete the database instance.
  5. Delete the snapshots.

Login to AWS

Click here to go to AWS Login Page.

When we hit the above link, we will see a web page as follows where we are required to log in using our login details.

Login page

You will see the main AWS Management console as follows when you successfully login into your account.

Main dashboard

Create a snapshot

Search for RDS in the search box which appears when you click on Services in the top left of the screen.

Click on the result.

Search RDS

This is the main dashboard of the RDS Service

It is assumed that you already have an RDS MySql instance and you want to take a snapshot of the existing instance

Click on "Databases" in the left panel.

RDS dashboard

You will get a list of instances you have in the chosen region.

Click on the instance you want to take a snapshot of, "Actions" and then click on "Take snapshot".

Take a backup

Give a name to the snapshot and click on the "Take snapshot" button to proceed.

Give a name to the backup/snapshot

The snapshot is being taken, this will take some time. Once the snapshot is ready, you can see "available" under status.

Backup completed

Restore a snapshot

The snapshot you have taken is now ready to be restored. When the snapshot is restored, it creates a new instance with data that is there in the snapshot.

To restore the snapshot, go to "Snapshots" in the left panel and select the snapshot to be restored. Click on the "Actions" button and then "Restore snapshot".

Restore a snapshot

Here, you need to provide all the information that is provided while creating an RDS Instance.

Give a name to the instance that will be created using this snapshot, specify the VPC.

Configure a new database instance

Create a new Security group or choose the one which belongs to the Instance from which you created a snapshot. 

Choose the size of the RDS instance that will be created using this snapshot.

Configure network and instance type

Once you provide all the relevant configuration, click on "Restore DB instance."

Create a new database instance from the snapshot/backup

This will take some time, wait till then.

Once the snapshot is restored successfully, you will see the status changed to "Available".

A new database instance is being created from the snapshot

Delete the database instance.

When you no longer need the instances, it is better to delete them. To delete the instance, select the instance and click on "Actions" --> "Delete".

Delete the database instance

Be careful while performing the deletion operation. You can even take a snapshot of the RDS instance before deleting it.

Acknowledge the deletion action and click on the "Delete" button

Confirm the database instance deletion

Delete a snapshot

To delete the snapshot if not needed, go to Snapshot and select the snapshot to be deleted and click on "Actions" --> "Delete the snapshot".

Delete the snapshot

Click on ''Delete" to confirm the deletion action. Once the snapshot is deleted, there is no way to retrieve it. Be careful while you perform the deletion action.

Confirm the snapshot deletion

Conclusion

In this article, we saw the steps to create a snapshot of an existing RDS MySql instance and restore it. At last, we also saw how to clean up RDS instances and snapshots.

Share this page:

0 Comment(s)