Menu
Amazon Relational Database Service
Command Line Interface Reference (API Version 2014-10-31)

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

The Amazon RDS Command Line Interface (RDS CLI) has been deprecated. Instead, use the AWS CLI for RDS. To learn how to download and use the AWS CLI, see AWS Command Line Interface User Guide. For RDS commands available in the AWS CLI, see AWS CLI Reference for Amazon RDS.

The AWS CLI does not currently support the DownloadCompleteDBLogFile REST API action. To download an entire log file at once, rather than in parts using the download-db-log-file-portion command, use the last published RDS CLI and the rds-download-db-logfile command.

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

This operation is not supported for Read Replica DB instances.

Syntax

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

-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 ]

[-ct (--copy-tags-to-snapshot) value ]

[-p (--port) value ]

[-st (--storage-type) value ]

[--iops value ]

[-og (--option-group) value]

[-pub (--publicly-accessible) value]

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

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

[-n (--db-name) value ]

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

[-tca (--tde-credential-arn) value ]

[-tcp (--tde-credential-password) value ]

[-tk (--tag-key) value ]

[-tv (--tag-value) value ]

[General Options]

Options

Name Description Required

-t value

--target-db-instance-identifier value

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

This parameter is the default parameter and can be passed as the first value in the command and without a parameter name, for example: rds-restore-db-instance-to-point-in-time my-target-db-instance-identifier.

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 source-db-instance-identifier.

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

  • Cannot be specified if use-latest-restorable-time parameter is true.

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

Conditional

-z value

--availability-zone value

The Amazon 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.medium | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge | db.m3.medium | db.m3.large | db.m3.xlarge | db.m3.2xlarge | db.r3.large | db.r3.xlarge | db.r3.2xlarge | db.r3.4xlarge | db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium | db.t2.large | db.m4.large | db.m4.xlarge | db.m4.2xlarge | db.m4.4xlarge | db.m4.10xlarge

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

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

No

--copy-tags-to-snapshot

-ct

True to copy all tags from the restored DB instance to snapshots of the DB instance; otherwise false. The default is false.

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

No

-p value

--port value

Port number that the DB instance uses for connections.

Type: Integer

Default: The value used in the DB snapshot

Example: --port 1234

No

-st value

--storage-type value

Specifies the storage type for the DB instance.

Type: String

Valid values: standard | gp2 | io1.

Default: io1 if the --iops parameter is specified; otherwise standard

If you specify io1, you must also include a value for the --iops parameter.

No

--iops value

Specifies the amount of provisioned IOPS for the DB instance, expressed in I/O operations per second.

If this parameter is not specified, the IOPS value will be taken from the original instance. If this parameter is set to 0, the new instance will not have provisioned IOPS.

Constraints: Must be an integer greater than 1000.

SQL Server

You cannot change the provisioned IOPS for a SQL Server DB instance.

No

-pub value

--publicly-accessible value

Specifies the accessibility options for the DB instance. A value of true specifies an Internet-facing instance with a publicly resolvable DNS name, which resolves to a public IP address. A value of false specifies an internal instance with a DNS name that resolves to a private IP address.

If you change this setting from true to false, you break any connections to the DB instance that are using the public IP address.

No

-m value

--multi-az value

Specifies if the new DB instance is a Multi-AZ deployment. Not a valid option for SQL Server Multi-AZ mirrored instances. To configure Multi-AZ for a SQL Server instance, apply or remove the "Mirroring" option using Option Groups.

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

-og value

--option-group value

Specifies the name of the option group that should be associated with the restored instance.

Permanent options, such as the TDE option for Oracle Advanced Security TDE, can never be removed from an option group, and that option group cannot be removed from a DB instance once it is associated with a DB instance.

Type: String

No

-n value

--db-name value

The meaning of this parameter differs according to the database engine you use.

MySQL

Name of a database to create when the DB instance is created. If this parameter is not specified, no database is created in the instance.

Constraints:

  • Cannot be empty.

  • Must contain 1 to 64 alphanumeric characters.

  • Cannot be a word reserved by the specified database engine.

Type: String

Example: --db-name MyDatabase

PostgreSQL

Name of a database to create when the DB instance is created. If this parameter is not specified, the default "postgres" database is created on the instance.

Constraints:

  • Must contain 1 to 63 alphanumeric characters.

  • Cannot be a word reserved by the specified database engine.

Type: String

Example: --db-name pgDatabase

Oracle

The Oracle System ID (SID) of the created DB instance.

Constraints:

  • Cannot be longer than 8 characters.

Type: String

Example: --db-name MYORACLE

SQL Server

Not applicable.

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-name value

The name of the DB subnet group to restore into. Specifying a DB subnet group will restore to a DB instance in the named VPC.

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

-tca value

--tde-credential-arn value

The ARN of the HSM HA Partition Group used for the TDE HSM option.

No

-tcp value

--tde-credential-password value

The password of the HSM HA Partition Group used for the TDE HSM option.

No

--tag-key

-tk

The name of a tag to add for the restored DB instance.

No

--tag-value

-tv

The value of the tag to add for the restored DB instance.

No

Output

The command returns a table that contains the following information:

Note

Output values list the possible values returned by CLI commands. Not all values are returned for every call to a command. If a value is null or empty, it will not be included in the command output. For example, CLI commands to create or restore a DB instance will not return the Endpoint Address value because that value is null until the DB instance has finished being created or restored.

  • 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

  • CopyTagsToSnapshot—Specifies whether tags are copied from the DB instance to snapshots of the DB instance.

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

  • Storage—Initially allocated storage size specified in GBs

  • Storage Type—The type of storage specified

  • Iops—The provisioned storage IOPS, expressed as I/O operations per second

  • Storage Encrypted—Indicates whether the DB instance is encrypted

  • KmsKeyId—If Storage Encrypted is true, the KMS key identifier for the encrypted DB instance

  • Resource Id—If Storage Encrypted is true, the region-unique, immutable identifier for the encrypted DB instance. This identifier is found in AWS CloudTrail log entries whenever the KMS key for the DB instance is accessed.

  • 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

  • SecondaryAvailabilityZone—If present, specifies the name of the secondary Availability Zone for a DB instance with multi-AZ support.

  • 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.

Copy
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.

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