This topic describes how to replicate databases between ApsaraDB RDS instances that run SQL Server 2012 or SQL Server 2016 by using the ApsaraDB RDS console or API operations.

Prerequisites

The source and destination RDS instances meet the following requirements:
  • The source and destination RDS instances belong to the same Alibaba Cloud account.
  • The source and destination RDS instances run the same version of database engine. Supported database engine versions are SQL Server 2012 and SQL Server 2016.
  • The source and destination RDS instances reside in the same region and use the same network type. Their zones can be different.
  • The source and destination RDS instances do not have databases whose names are the same.
  • The available storage capacity of the destination RDS instance is larger than the size of the databases that you want to replicate from the source RDS instance.

Background information

During the replication process, ApsaraDB RDS first performs a full backup of the source RDS instance and then replicates databases to the destination RDS instance. If the source RDS instance is written during the replication process, incremental data of the source RDS instance is not replicated to the destination RDS instance.

You can choose to replicate a single database or all databases in the source RDS instance. If the replication task fails, no data is transferred to the destination RDS instance. This ensures data consistency.

Procedure

  1. Go to the Databases page.
    1. Log on to the ApsaraDB for RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where your RDS instance resides.
      选择地域
    2. Find your RDS instance and click its ID. In the left-side navigation pane, click Databases.
  2. Click Replicate to Another Instance. In the dialog box that appears, configure the following parameters.
    Parameter Description
    Source Instance Name The ID of the source RDS instance.
    Target Instance Name

    The ID of the destination RDS instance.

    The drop-down list displays all the RDS instances that reside in the same region and use the same SQL Server version as the source RDS instance. You can select the destination RDS instance from the drop-down list.

    Source Databases

    The databases that you want to replicate to the destination RDS instance. You can click the > or < icon to select the databases.

    If you select more than one database or all databases, make sure that the following conditions are met:
    • The available storage capacity of the destination RDS instance is larger than the size of the databases that you want to replicate from the source RDS instance.
    • The source and destination RDS instances do not have databases whose names are the same.
    Note If the source and destination RDS instances have databases whose names are the same, these databases are not replicated.
    Users and Authorizations

    Specify whether to replicate accounts and account permissions to the destination RDS instance.

    • Synchronize Database Users and Authorizations: Accounts and account permissions are replicated to the destination RDS instance. Take note of the following two scenarios:
      • If the destination RDS instance has accounts whose usernames are the same as those of accounts on the source RDS instance, the accounts on the destination RDS instance are granted the same permissions as the accounts on the source RDS instance.
      • If the destination RDS instance does not have the same accounts, the accounts are first created on the destination RDS instance and then granted the same permissions as the accounts on the source RDS instance.
    • Replicate Database Only. Do Not Synchronize Users and Authorizations: Accounts and account permissions are not replicated to the destination RDS instance. This option is the default value. After replication is complete, you can create accounts on the destination RDS instance and grant permissions on the selected databases. For more information, see Create accounts and databases for an ApsaraDB RDS instance that runs SQL Server 2012, 2016, 2017 SE, or 2019.
  3. Click OK.