API Actions: CreateAllReplication

API Actions: CreateAllReplication


Request Syntax:

XML

POST /api/CreateAllReplication HTTP/1.1
Host: use.your.host.name:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/xml
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential= UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74

<?xml version="1.0" encoding="utf-8"?>
<CreateAllReplicationRequest>
	<ReplicationMethod>ContinuousWithAutoSeeding</ReplicationMethod>
	<ReplicateLoginsUsersAndRoles>true</ReplicateLoginsUsersAndRoles>
	<ReplicateTablesOnly>false</ReplicateTablesOnly>
	<ParallelTablesLimit>5</ParallelTablesLimit>
	<RebuildIndexes>false</RebuildIndexes>
	<Source>
		<ConnectionString>Data Source=your-source-db-server;Initial Catalog=your-source-db;Persist Security Info=False;User ID=user-name;Password=******;Connect Timeout=1280</ConnectionString>
		<EncryptDataInTransit>true</EncryptDataInTransit>
		<ChangeTrackingRetentionPeriod>2 DAYS</ChangeTrackingRetentionPeriod>
	</Source>
	<Destination>
		<ConnectionString>Data Source=your-destination-db-server;Initial Catalog=your-destination-db;Persist Security Info=False;User ID=user-name;Password=******;Connect Timeout=1280</ConnectionString>
		<EncryptDataInTransit>true</EncryptDataInTransit>
		<ReplicateCompatibilityLevel>true</ReplicateCompatibilityLevel>
	</Destination>
	<AddUpdateTimestamp>false</AddUpdateTimestamp>
	<skipExisting>false</skipExisting>
	<ignoreDbDependencies>false</ignoreDbDependencies>
</CreateAllReplicationRequest>

JSON

POST /api/CreateAllReplication HTTP/1.1
Host: use.your.host.name:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/json
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential= UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74

{
	"replicationMethod": "ContinuousWithAutoSeeding",
	"replicateLoginsUsersAndRoles": true,
	"replicateTablesOnly": false,
	"parallelTablesLimit": 0,
	"rebuildIndexes": false,
	"source": {
		"connectionString": "Data Source=Data Source=your-source-db-server;Initial Catalog=your-source-db;Persist Security Info=False;User ID=user-name;Password=******;Connect Timeout=1280",
		"encryptDataInTransit": true,
		"changeTrackingRetentionPeriod": "2 DAYS"
	},
	"destination": {
		"connectionString": "Data Source=your-destination-db-server;Initial Catalog=your-destination-db;Persist Security Info=False;User ID=user-name;Password=******;Connect Timeout=1280",
		"encryptDataInTransit": true,
		"replicateCompatibilityLevel": true
	},
	"addUpdateTimestamp": false,
	"skipExisting": true,
	"ignoreDbDependencies": false
}


 

Request Parameters

Parameter Description Required
ReplicationMethod Possible values are:

  • ContinuousWithAutoSeeding
  • OneTimeWithAutoSeeding
Yes
ContinuousWithAutoSeeding Continuous replication w/ automatic seeding and change tracking activation.
Replicate entire SQL Server or a single database w/ automatic seeding (no backup/restore required; destination/read-replica databases are created automatically). Upon successful completion of the seeding, a change tracking schedule (under \Replication\Replication Schedules) will be configured automatically. This option is suitable for replicating smaller size databases. It can be utilized to replicate large size databases if SQL Server backup/restore is not available. All RDS and EC2 SQL Server version 2008 and above, and including Web Edition are supported.
Replication scenarios include but are not limited to continuous replication of: · On-Premise, RDS or EC2 SQL Server to one or multiple RDS or EC2 SQL Server instances for Reporting or DR.
· RDS to one or multiple RDS Multi-AZ Readable-Replica instances for HA and/or to offload primary
· RDS to one or multiple RDS Cross-Region (Multi-AR) Readable-Replica instances located in same or multiple regions for DR and/or Data-Locality.
OneTimeWithAutoSeeding One-time replication of all SQL Server databases or a single database without change tracking activation (cannot be activated at a later time). Destination replica database(s) are created automatically.
Type: String
Default: None
ReplicateLoginsUsersAndRoles Indicates whether the users and roles will be replicated from the source database instance to the destination database instance.

Note:Set ReplicateLoginsUsersAndRoles=true for DR replications. For reporting use cases replicating logins and roles might not be necessary.
For security reasons random passwords are assigned. Passwords need to be manually reset on the replica SQL Server after the initial database replication seeding completes. Password changes are also not automatically replicated as part of the schema replication process.

Yes
Type: String
Default: None
Valid value: true/ false
ReplicateTablesOnly When set to true, only database tables and their data will be replicated. Views, Stored Procedures, Triggers and Functions will not be replicated.

Note:
Using ReplicateTablesOnly=true is most applicable to use cases where the replicated database will be used primarily for reporting purposes.

Yes
Type: String
Default: None
Valid value: true/ false
ParallelTablesLimit Indicates the maximum number of parallel table replications at any given moment. Instances with insufficient performance can get saturated if a large number of parallel table replications is requested.

Note:
Higher value will decrease the total time to complete the seeding, but might affect the performance of the source RDS/SQL Server depending on server type and size. For AWS RDS, value of 10 is recommended for RDS type *.Large or below.

Yes
Type: Numeric
Default: None
RebuildIndexes Indicates whether the indexes should be rebuilt in the destination database instance.

Note:
Rebuilding of indexes upon completion of seeding might be necessary when deadlocks occur in the destination database.

Yes
Type: String
Default: None
Valid value: true/ false
Source
ConnectionString A valid connection string to the source database instance. Yes
Type: String
Default: None
EncryptDataInTransit Indicates whether data in transit should be encrypted.

Note:
TLS 1.2 is activated for SQL Server 2016 and prior versions that have been updated to support TLS 1.2. TLS 1.1, 1.0 or SSL are activated if the SQL Server version does not support TLS 1.2

Yes
Type: String
Default: None
Valid value: true/ false
ChangeTrackingRetentionPeriod Specifies the period that Change Tracking data is saved for before being automatically purged. Yes
Type: String
Default: None
Valid values: 12 Hours, 1 Day, 2 Days, 3 Days, 4 Days, 5 Days, 6, Days, 7 Days, 8 Days
Destination
ConnectionString A valid connection string to the source database instance. Yes
Type: String
Default: None
EncryptDataInTransit Indicates whether data in transit should be encrypted.

Note:
TLS 1.2 is activated for SQL Server 2016 and prior versions that have been updated to support TLS 1.2. TLS 1.1, 1.0 or SSL are activated if the SQL Server version does not support TLS 1.2

Yes
Type: String
Default: None
Valid value: true/ false
ReplicateCompatibilityLevel Replicate the compatibility level of the source database.

Note:
Valid values for SQL Server 2014 are 100, 110 and 120. Valid values for SQL Server 2016 are 100, 110, 120 & 130.

Yes
Type: String
Default: None
Valid value: true/ false
AddUpdateTimestamp Indicates whether to add a field named [cb_sys_update_timestamp] to each destination/replica table Yes
Type: String
Default: None
Valid value: true/ false
skipExisting Setting this parameter to true will cause any databases existing on the destination server to be skipped without generating an error message.
Setting this parameter to false will prevent the replication from starting and will generate an error message if any of the databases to be replicated already exist on the destination server.
Yes
Type: String
Default: None
Valid value: true/ false
ignoreDbDependencies Setting this parameter to true will allow the replication to start even if some of the databases to be replicated contain references to non-existing databases or databases on another server.
Setting this parameter to false prevent the replication from starting and will generate an error message if any of the databases to be replicated contain references to non-existing databases or databases on another server.
Yes
Type: String
Default: None
Valid value: true/ false

 

Request Headers

This implementation uses only request headers that are common to all operations. For more information please see the section Common Request Headers
 

Response Syntax:

XML

HTTP/1.1 200
status: 200
<?xml version="1.0" encoding="utf-8"?>
< CreateAllReplicationResponse>
	<Replications>
		<Replication>
			<ReplicationId>594ed5c8-e0aa-4fd0-987f-fcfd2aaf1763</ReplicationId>
			<DatabaseName>DB_1</DatabaseName>
			<Status>Running</Status>
			<Note />
		</Replication>
		<Replication>
			<ReplicationId>794ed5c8-e0aa-4fd0-987f-fcfd2aaf1763</ReplicationId>
			<DatabaseName>DB_2</DatabaseName>
			<Status>InQueue</Status>
			<Note />
		</Replication>
		<Replication>
			<ReplicationId>994ed5c8-e0aa-4fd0-987f-fcfd2aaf1763</ReplicationId>
			<DatabaseName>DB_3</DatabaseName>
			<Status>InQueue</Status>
			<Note />
		</Replication>
	</Replications>
</ CreateAllReplicationResponse>

JSON

HTTP/1.1 200
status: 200
{
	"replications": 
	[
		{
			"replicationId": "594ed5c8-e0aa-4fd0-987f-fcfd2aaf1763",
			"databaseName": "DB_1",
			"status": "Running",
			"note": ""
		},
		{
			"replicationId": "794ed5c8-e0aa-4fd0-987f-fcfd2aaf1763",
			"databaseName": "DB_2",
			"status": "InQueue",
			"note": ""
		},
		{
			"replicationId": "994ed5c8-e0aa-4fd0-987f-fcfd2aaf1763",
			"databaseName": "DB_3",
			"status": "InQueue",
			"note": ""
		}
	]
}


 

Response Parameters

Parameter Description Optional
ReplicationID It is a GUID that uniquely identifies every Replication. No
DatabaseName The name of the database that is being replicated No
Status The current status of the Replication task. Possible options include:

  • Running
  • RunningWithErrors
  • RunningWithWarnings
  • Failed
  • Success
  • CompletedWithErrors
  • CompletedWithWarnings
No
Note If the replication was created with ReplicateLoginsUsersAndRoles=true, the following message will be included in the Note:

For security reasons random passwords are assigned to any replicated logins and users. Passwords need to be manually reset on the replica SQL Server after the initial database replication seeding completes. Password changes are also not automatically replicated as part of the schema replication process.

Yes

 

Error Response Syntax:

XML

HTTP/1.1 400
status: 400

<?xml version="1.0" encoding="utf-8"?>
<ErrorResponse> 
	<RequestId>request-id</RequestId> 
	<Errors> 
		<Error> {Destination\ConnectionString}: Destination Connection String status: InaccessibleDatabase </Error> 
	</Errors> 
</ErrorResponse>

JSON

HTTP/1.1 400
status: 400

{
    "errors": [
        "{Destination\ConnectionString}:The database must not exist. It will be created by the replication process. Delete the database or use a different name."
    ],
    "requestId": "21"
}