For ApsaraDB RDS SQL Server 2012 and 2016, you can copy database data from one instance to another in the ApsaraDB for RDS console or by using OpenAPI Explorer.

Prerequisites

The following conditions must be met:
  • The source and destination instances belong to the same Alibaba Cloud account.
  • The engine versions of the source and destination instances are the same. Supported versions: ApsaraDB RDS SQL Server 2012 and 2016.
  • The source and destination instances are in the same region and can belong to different zones. The network types must be the same.
  • The source and destination instances do not have databases whose names are the same.
  • The available storage space of the destination instance is larger than the size of the databases to be copied.

Background information

ApsaraDB RDS SQL Server completes a full backup of the source instance before it copies data from the source instance to the destination instance. During the data copy process, incremental data of the source instance is not copied to the destination instance.

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

For more information about related operations, see CopyDatabaseBetweenInstances.

Procedure

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the source instance is located.Select a region
  3. Find the instance and click the instance ID.
  4. In the left-side navigation pane, click Databases.
  5. Click Replicate to Another Instance.

    The parameter configurations are as shown in Table 1.

    Table 1. Parameter configurations
    Parameter Description
    Source Instance Name The ID of the source instance.
    Target Instance Name

    The ID of the destination instance.

    All instances that are in the same region and have the same version as the source instance are displayed. Select a destination instance. You can also search for your destination instance by instance ID or instance name in the search box.

    Source Databases

    Specify the databases to be copied to the destination instance. You can click Add or Delete to select the databases.

    If you select multiple or all databases, make sure the following conditions are met:
    • The available storage space of the destination instance is larger than the size of the databases to be copied.
    • The source and destination instances do not have databases whose names are the same.
    Note If the source and destination instances have databases whose names are the same, these databases are not copied.
    Users and Authorizations

    Specify whether to copy users and permissions to the destination instance.

    • Synchronize Database Users and Authorizations: The users and permissions of the source databases will be copied to the destination instance. The following scenarios exist.
      • If users of the same names already exist in the destination instance, the users are authorized with permissions of the source instance users.
      • If the destination instance does not have the same user as the user to be copied from the source instance, the user is created in the destination instance and authorized with permissions of the source instance user.
    • Replicate Database Only. Do Not Synchronize Users and Authorizations: The users and permissions of the source databases will not be copied to the destination instance. This is the default option. You can create user accounts and assign permissions for these databases after the copy is complete. For more information, see Create databases and accounts for an RDS instance in SQL Server 2017 SE, 2016, or 2012.
  6. After these parameters are configured, click OK.