Amazon Relational Database Service
Command Line Interface Reference (API Version 2012-04-23)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

rds-restore-db-instance-to-point-in-time

Description

Restores a DB Instance to a specified point in time, creating a new DB Instance.

Some characteristics of the new DB Instance can be modified using optional parameters; if these are omitted, the new DB Instance defaults to the characteristics of the DB Instance from which the DB Snapshot was created.

[Note]Note

This operation is not supported for Read Replica DB Instances.

Syntax

rds-restore-db-instance-to-point-in-time TargetDBInstanceIdentifier

-s (--source-db-instance-identifier) value

[-l (--use-latest-restorable-time) ]

[-e (--engine) value ]

[-lm (--license model) value ]

[-r (--restore-time) value ]

[-z (--availability-zone) value ]

[-c (--db-instance-class) value ]

[-p (--port) value ]

[-m (--multi-az) value]

[-au (--auto-minor-version-upgrade) value ]

[-sn (--db-subnet-group-name) value ]

[General Options]

Options

NameDescriptionRequired

TargetDBInstanceIdentifier

DB Instance identifier. This is the unique key that identifies a DB Instance.

Type: String

Default: None

Constraints: Must contain 1 to 63 alphanumeric characters or hyphens. First character must be a letter. Cannot end with a hyphen or contain two consecutive hyphens.

Example: mydbinstance

Yes

-s value

--source-db-instance-identifier value

User-supplied identifier of the DB Instance from which to restore. This instance must be available and must have automated backups enabled.

Type: String

Yes

-l

--use-latest-restorable-time

Specifies that the DB Instance is restored from the latest backup time.

Type: Boolean

Default: False

Constraints: Cannot be specified if RestoreTime parameter is provided.

Conditional

-lm

--license-model value

License model for the new DB Instance.

Type: String

Default: Same as the source DB Instance.

Valid values: license-included | bring-your-own-license | general-public-license

Example: --license-model bring-your-own

No

-r value

--restore-time value

The date and time from to restore from.

Type: Date

Default: none

Valid Values: Value must be a UTC time

Constraints:

  • Time specified must be after the creation of the oldest system snapshot available for SourceDBInstanceIdentifier.

  • Cannot be after the latest restorable time for the DB Instance.

  • Cannot be specified if UseLatestRestorableTime parameter is true.

Example: 2009-09-07T23:45:00Z

Conditional

-z value

--availability-zone value

The EC2 Availability Zone that the DB Instance will be created in.

Type: String

Default: The Availability Zone of the source DB Instance.

Example: -z us-east-1c

No

-c value

--db-instance-class value

Contains the compute and memory capacity of the DB Instance.

Type: String

Default: The instance class of the source DB Instance. Different instance classes are available for different database engines. For information about valid values for a particular engine, use the rds-describe-orderable-db-instance-options command.

Valid values: db.t1.micro | db.m1.small | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge

Example: --db-instance-class db.m1.xlarge

No

-e value

--engine value

Name of the database engine to use for the new DB Instance.

Type: String

Default: Same as the source DB Instance.

Valid values: MySQL | oracle-se1 | oracle-se | oracle-ee

Yes

-p value

--port value

Port number that the DB Instance uses for connections.

Type: Integer

Default: The port of the source DB Instance.

Example: --port 1234

No

-m value

--multi-az value

Specifies if the new DB Instance is a Multi-AZ deployment.

Type: Boolean

Default: false

Valid values: true | false

Constraints: The --availability-zone parameter cannot be set if the --multi-az parameter is set to true.

No

-au value

--auto-minor-version-upgrade value

Indicates that minor version upgrades will be applied automatically to the DB Instance during the maintenance window.

Type: Boolean

Example: --au true

No

-sn value

--db-subnet-group value

The name of the DB Subnet Group to retore into. Specifying a DB Subnet Group will restore to a DB Instance in the named VPC.

[Note]Note

You can restore a DB Instance from a VPC to a DB Instance in another VPC, or from a non-VPC DB Instance into a DB Instance in a VPC. You cannot restore from a VPC to a DB Instance that is not in a VPC.

Type: String

Default: none

Constraints: Must be the name of an existing DB Subnet Group.

Example: --db-subnet-group-name mydbsubnetgroup

No

Output

The command returns a table that contains the following information:

  • DBInstanceID—the user-supplied database identifier

  • Created—the data and time the instance was created, in UTC

  • Class—The compute and memory capacity of the instance

  • Engine—Name of the database engine to be used for this DB Instance

  • Storage—Initially allocated storage size specified in GBs

  • Master Username—The master username for the instance

  • Status—The current status of the instance. Valid values: available | backing-up | creating | deleted | deleting | failed | modifying | rebooting | resetting-master-credentials

  • Endpoint Address—Address of the DB Instance.

  • Port—Port used to connect to the DB Instance.

  • AZ—The instance's Availability Zone.

  • Backup Retention—The number of days that automated backups are retained before deletion.

  • PendingBackupRetention—The backup retention period which will be applied at the next maintenance window, or which is currently being applied if the --apply-immediately option was specified.

  • PendingClass—The class to which the instance will be scaled during the next maintenance window, or to which it is currently being scaled if the --apply-immediately option was specified.

  • PendingCredentials—The (hidden) master user password that will be applied to the DB Instance.

  • PendingStorage—The storage size to which the instance will be scaled during the next maintenance window, or to which it is currently being scaled if the --apply-immediately option was specified.

  • DB Name—Name of the initial database created when the instance was created. This column appears only in the --show-long view.

  • Maintenance Window—The window during which patching and instance modifications will be performed. This column appears only in the --show-long view.

  • Backup Window—The period during which daily automated backups are created. This column appears only in the --show-long view.

  • Name—Security Group name.

  • Status—Status of authorization. Valid values: authorizing | authorized | revoking

  • Name—DB Subnet Group name.

  • Description—DB Subnet Group description.

  • Group Name—Name of DB Parameter Group applied to.

  • Apply Status—Status of applying the parameter group. It can be either in-sync or pending-reboot.

  • Multi-AZ—Indicates if this is a Multi-AZ DB Instance.

  • EngineVersion—Database engine version number.

Examples

Restore a Database to a Specified Time with Minimal Parameters

This example restores a database to a specified time with the minimal set of parameters.

PROMPT> rds-restore-db-instance-to-point-in-time restored-db -s original-db -r 2009-07-31T13:00:00Z
                    

Restore a Database to a Specified Time, Specifying a New Availability Zone

This example restores a database to a specified time with a new Availability Zone.

PROMPT> rds-restore-db-instance-to-point-in-time restored-db -s original-db -r 2009-07-31T13:00:00Z -z us-east-1b