Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Restoring From a DB Snapshot

Amazon RDS creates a storage volume snapshot of your DB instance, backing up the entire DB instance and not just individual databases. You can create a DB instance by restoring from this DB snapshot. When you restore the DB instance, you provide the name of the DB snapshot to restore from, and then provide a name for the new DB instance that is created from the restore. You cannot restore from a DB snapshot to an existing DB instance; a new DB instance is created when you restore.

When you restore a DB instance, only the default DB parameter and security groups are associated with the restored instance. As soon as the restore is complete, you should associate any custom DB parameter or security groups used by the instance you restored from. You must apply these changes explicitly using the RDS console's Modify command, the ModifyDBInstance Amazon RDS API, or the AWS CLI modify-db-instance command line tool, once the DB instance is available. We recommend that you retain parameter groups for any DB snapshots you have so that you can associate a restored instance with the correct parameter file.

Note

If you use Oracle GoldenGate, always retain the parameter group with the compatible parameter. If you restore an instance from a DB snapshot, you must modify the restored instance to use the parameter group that has a matching or greater compatible parameter value. This should be done as soon as possible after the restore action, and will require a reboot of the instance.

The option group associated with the DB snapshot is associated with the restored DB instance once it is created. For example, if the DB snapshot you are restoring from uses Oracle Transparent Data Encryption, the restored DB instance will use the same option group, which had the TDE option. When an option group is assigned to a DB instance, it is also linked to the supported platform the DB instance is on, either VPC or EC2-Classic (non-VPC). Furthermore, if a DB instance is in a VPC, the option group associated with the instance is linked to that VPC. This means that you cannot use the option group assigned to a DB instance if you attempt to restore the instance into a different VPC or onto a different platform. If you restore a DB instance into a different VPC or onto a different platform, you must either assign the default option group to the instance, assign an option group that is linked to that VPC or platform, or create a new option group and assign it to the DB instance. Note that with persistent or permanent options, such as Oracle TDE, you must create a new option group that includes the persistent or permanent option when restoring a DB instance into a different VPC.

You can change to a different edition of the DB engine when restoring from a DB snapshot only if the DB snapshot has the required storage allocated for the new edition. For example, to change from SQL Server Web Edition to SQL Server Standard Edition, the DB snapshot must have been created from a SQL Server DB instance that had at least 200 GB of allocated storage, which is the minimum allocated storage for SQL Server Standard edition.

You can restore a DB instance and use a different storage type than the source DB snapshot. In this case the restoration process will be slower because of the additional work required to migrate the data to the new storage type. In the case of restoring to or from Magnetic (Standard) storage, the migration process is the slowest as Magnetic storage does not have the IOPS capability of Provisioned IOPS or General Purpose (SSD) storage.

Note

Amazon RDS does not support changing the storage configuration for a SQL Server DB instance when restoring from a DB snapshot.

In this example, you restore from a previously created DB snapshot called mydbsnapshot and create a new DB instance called mynewdbinstance.

AWS Management Console

To restore a DB instance from a DB snapshot

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Snapshots.

  3. Choose the DB snapshot that you want to restore from.

    
							Console restore snapshot db

  4. Choose Restore Snapshot.

    The Restore DB Instance window appears.

  5. Type the name of the restored DB instance in the DB Instance Identifier text box.

  6. Choose Restore DB Instance.

  7. Only the default DB parameter and security groups are associated with the restored instance. If you want to restore the functionality of the DB instance to that of the DB instance that the snapshot was created from, you must modify the DB instance to use the security group and parameter group used by the previous DB instance. The next steps assume that your DB instance is in a VPC; if your DB instance is not in a VPC, use the EC2 Management Console to locate the security group you need for the DB instance.

  8. Sign in to the AWS Management Console and open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  9. In the navigation pane, choose Security Groups.

  10. Select the security group that you want to use for your DB instances. If you need to add rules to link the security group to a security group for an EC2 instance, see A DB Instance in a VPC Accessed by an EC2 Instance in the Same VPC for more information.

CLI

To restore a DB instance from a DB snapshot, use the AWS CLI command restore-db-instance-from-db-snapshot.

For Linux, OS X, or Unix:

Copy
aws rds restore-db-instance-from-db-snapshot \ --db-instance-identifier mynewdbinstance \ --db-snapshot-identifier mydbsnapshot

For Windows:

Copy
aws rds restore-db-instance-from-db-snapshot ^ --db-instance-identifier mynewdbinstance ^ --db-snapshot-identifier mydbsnapshot

This command returns output similar to the following:

Copy
DBINSTANCE mynewdbinstance db.m3.large MySQL 50 sa creating 3 n 5.6.27 general-public-license

After the DB instance has been restored, you must add the DB instance to the security group and parameter group used by the DB instance used to create the DB snapshot if you want the same functionality as that of the previous DB instance.

API

To restore a DB instance from a DB snapshot, call the Amazon RDS API function RestoreDBInstanceFromDBSnapshot with the following parameters:

  • DBSnapshotIdentifier = rds:mysqldb-2014-04-22-08-15

  • DBInstanceIdentifier = mynewdbinstance

Example

Copy
https://rds.us-east-1.amazonaws.com/ ?Action=RestoreDBInstanceFromDBSnapshot &DBInstanceIdentifier=mynewdbinstance &DBSnapshotIdentifier=rds%3Amysqldb-2014-04-22-08-15 &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140428/us-east-1/rds/aws4_request &X-Amz-Date=20140428T232655Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=78ac761e8c8f54a8c0727f4e67ad0a766fbb0024510b9aa34ea6d1f7df52fe92

Related Topics