Skip to content

Restoring AWS RDS MySQL Databases, down to the minute

It happens to all of us. New developers and experienced ones alike. The need to restore from your database backups.

I found myself in this position recently, and was disheartened to find the records I’d hoped to retrieve existed only in between daily snapshots of the database. The data was created after the second most recent backup, and was deleted before the most recent backup was taken.

It turns out that if you’re hosted on Amazon Web Services’ RDS database service, using MySQL, and with InnoDB database – there’s a solution. It’s called their post in time restore. It allows you to restore to any time within your backup retention period (the earliest available automated backup).

It does this using the MySQL binary log (aka the transaction log).

Using Point in Time Restore in the AWS Console

  1. Log into your AWS RDS Console.

  2. From the Database tab, select the radio button next to the RDS instance you’d like to restore from. From the “Actions” dropdown, choose the “Restore to point in time” option.
  1. The next screen will allow you to choose the time that you’d like to restore from. This is accurate to the minute.
AWS RDS "Point in Time" Recovery window. It gives the user two options: one to restore from the latest point in time available, the other to restore from a specific point in time, including date, hour and min
ute fields.
  1. Give a name to the new RDS instance, and adjust any other instance settings for the new instance.
RDS Instance Settings tab in the point in time restore screen. 

Asks for database engine, license model, source DB instance identifier and new DB instance identifier.

When you click on the “Restore to point in time” button at the bottom of the screen, AWS will create a new RDS instance with the data from the specific time you requested.

Using Point in Time Restore with the AWS CLI or API

You can also run a point in time restore using the AWS CLI or the RDS API. See the full instructions about the point in time restore feature in Amazon’s documentation.

What if I’m not on using AWS RDS?

If you’re using MySQL, but not on AWS RDS, you can also restore using the transaction log. See Point in Time Recovery Using Binary Log in the official MySQL documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.