restore_db_instance_to_point_in_time ( $source_db_instance_identifier, $target_db_instance_identifier, $opt )

Restores a DB Instance to an arbitrary point-in-time. Users can restore to any point in time before the latestRestorableTime for up to backupRetentionPeriod days. The target database is created from the source database with the same configuration as the original database except that the DB instance is created with the default DB security group.

Access

public

Parameters

Parameter

Type

Required

Description

$source_db_instance_identifier

string

Required

The identifier of the source DB Instance from which to restore. Constraints:

  • Must be the identifier of an existing database instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

$target_db_instance_identifier

string

Required

The name of the new database instance to be created. Constraints:

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

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • RestoreTime - string - Optional - The date and time to restore from. Valid Values: Value must be a UTC time Constraints:
    • Must be before the latest restorable time for the DB Instance
    • Cannot be specified if UseLatestRestorableTime parameter is true
    Example: 2009-09-07T23:45:00Z May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().
  • UseLatestRestorableTime - boolean - Optional - Specifies whether (true) or not (false) the DB Instance is restored from the latest backup time. Default: false Constraints: Cannot be specified if RestoreTime parameter is provided.
  • DBInstanceClass - string - Optional - The compute and memory capacity of the Amazon RDS DB instance. Valid Values: db.t1.micro | db.m1.small | db.m1.medium | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge Default: The same DBInstanceClass as the original DB Instance.
  • Port - integer - Optional - The port number on which the database accepts connections. Constraints: Value must be 1150-65535 Default: The same port as the original DB Instance.
  • AvailabilityZone - string - Optional - The EC2 Availability Zone that the database instance will be created in. Default: A random, system-chosen Availability Zone. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true. Example: us-east-1a
  • DBSubnetGroupName - string - Optional - The DB subnet group name to use for the new instance.
  • MultiAZ - boolean - Optional - Specifies if the DB Instance is a Multi-AZ deployment. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true.
  • PubliclyAccessible - boolean - Optional -
  • AutoMinorVersionUpgrade - boolean - Optional - Indicates that minor version upgrades will be applied automatically to the DB Instance during the maintenance window.
  • LicenseModel - string - Optional - License model information for the restored DB Instance. Default: Same as source. Valid values: license-included | bring-your-own-license | general-public-license
  • DBName - string - Optional - The database name for the restored DB Instance.

    This parameter is not used for the MySQL engine.

  • Engine - string - Optional - The database engine to use for the new instance. Default: The same as source Constraint: Must be compatible with the engine of the source Example: oracle-ee
  • Iops - integer - Optional - The amount of Provisioned IOPS (input/output operations per second) to be initially allocated for the DB Instance. Constraints: Must be an integer greater than 1000.
  • OptionGroupName - string - Optional -
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Restore a database instance to a point in time.

// Instantiate the class
$rds = new AmazonRDS();

$response = $rds->restore_db_instance_to_point_in_time('myInstance', 'myInstancerestore', array(
	'RestoreTime' => 'yesterday',
	'AutoMinorVersionUpgrade' => 'true'
));

// Success?
var_dump($response->isOK());

Related Methods

Source

Method defined in services/rds.class.php | Toggle source view (14 lines) | View on GitHub

public function restore_db_instance_to_point_in_time($source_db_instance_identifier, $target_db_instance_identifier, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['SourceDBInstanceIdentifier'] = $source_db_instance_identifier;
    $opt['TargetDBInstanceIdentifier'] = $target_db_instance_identifier;
    
    // Optional DateTime
    if (isset($opt['RestoreTime']))
    {
        $opt['RestoreTime'] = $this->util->convert_date_to_iso8601($opt['RestoreTime']);
    }

    return $this->authenticate('RestoreDBInstanceToPointInTime', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback