All Products
Search
Document Center

ApsaraDB RDS:Migrate data from a self-managed SQL Server database to an ApsaraDB RDS for SQL Server instance by using a physical gateway

更新时间:Dec 11, 2025

This topic describes how to migrate data from a self-managed SQL Server database to an Alibaba Cloud ApsaraDB RDS for SQL Server instance by using the physical gateway-based migration feature of Data Transmission Service (DTS). Different migration solutions are provided based on whether the server where the self-managed database resides has Internet access, including direct Internet access and network communication through a bastion host. This feature uses the physical gateway protocol for connection, offering advantages such as high speed, simple operation, and high stability. It can flexibly adapt to various network environments and significantly improve migration efficiency.

Select a migration solution

Select an appropriate migration solution based on your network environment. For more information, see Appendix: Comparison between backup gateway-based migration and logical data migration.

Migration solution

Solution description

Scenario 1: The server where the self-managed SQL Server database resides has direct Internet access

  1. Install the DBS backup gateway on the server where the source self-managed database resides.

    The backup gateway is the backup software that is installed on the database server. During data backup, the backup gateway connects and queries databases, and then sends data to the bastion host on which the proxy gateway is installed. During restoration, the backup gateway receives data over the Internet by using the proxy gateway on the bastion host and writes the data to the database.
  2. In the DTS console, select Physical Protocol as the access method to migrate data from the self-managed SQL Server database to the RDS for SQL Server instance.

Scenario 2: The server where the self-managed SQL Server database resides cannot directly access the Internet, but a bastion host is used for network communication

Click to view the configuration flow chart

image
  1. Install a proxy gateway on the bastion host.

    During data backup, the proxy gateway receives data from the database server on which the backup gateway is located and forwards the data to DBS cloud storage over the Internet. During restoration or database downloading, the proxy gateway receives data from DBS cloud storage and forwards the data to the database server.
  2. Install the DBS backup gateway on the server where the self-managed database resides, and specify the IP address of the proxy gateway (the internal IP address of the bastion host) during installation.

  3. After establishing network connectivity in Steps 1 and 2, select Physical Protocol as the access method in the DTS console to migrate data from the self-managed SQL Server database to the RDS for SQL Server instance.

Prerequisites

Different migration solutions have different requirements. Check the corresponding requirements based on your selected migration solution.

Scenario 1: With Internet access

  • The self-managed SQL Server database runs SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, or SQL Server 2005.

    Note

    The self-managed SQL Server database can reside on an Alibaba Cloud ECS instance, in a data center, or on a third-party cloud server. Cloud databases are not supported.

  • The RDS for SQL Server instance meets the following requirements:

    • The RDS instance runs SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2012, or SQL Server 2008 R2.

    • The RDS instance runs the same or a later engine version than the self-managed SQL Server database.

  • The following permissions are granted by using your Alibaba Cloud account:

Scenario 2: Without Internet access

  • The self-managed SQL Server database meets the following requirements:

    • The self-managed SQL Server database runs SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, or SQL Server 2005.

      Note

      The self-managed SQL Server database can reside on an Alibaba Cloud ECS instance, in a data center, or on a third-party cloud server. Cloud databases are not supported.

    • Do not set the HTTP_PROXY and HTTPS_PROXY environment variables on the server where the self-managed database resides.

      Important

      If you configure the preceding environment variables, the system preferentially uses the proxy gateway that is specified by the environment variables. As a result, the proxy gateway that is installed on the bastion host is not used, and network connections fail.

  • The RDS for SQL Server instance meets the following requirements:

    • The RDS instance runs SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2012, or SQL Server 2008 R2.

    • The RDS instance runs the same or a later engine version than the self-managed SQL Server database.

  • If the operating system of the bastion host is Linux, you must first install Java Runtime Environment (JRE) 1.8 on the server where the self-managed database resides. You can visit the official website to download and install JRE.

  • The following permissions are granted by using your Alibaba Cloud account:

Limits

The following limits apply when you migrate data by using DTS. Pay attention to these limits. Otherwise, the migration task may fail or report errors:

Source database limits

  • Only SQL Server on Windows is supported. The version of the desktop operating system cannot be earlier than Windows XP. The version of the server operating system cannot be earlier than Windows Server 2003.

  • The size of the source database cannot exceed the remaining storage of the destination RDS instance. Otherwise, the cloud migration fails.

  • The name of the source database cannot be the same as the name of the destination database on the RDS instance.

  • The name of the source database cannot be the same as the names of some system databases or other database names that cannot be used. Examples:

    reserved_dbname = ["master", "tempdb", "msdb", "model", "distribution","rdscore","sys_info"]
  • The network settings of the source database must meet the following requirements:

    • If the firewall for the source database is disabled and the source database is a self-managed database on an ECS instance, you can connect the source database and the destination database over a virtual private cloud (VPC) or the Internet.

    • If the firewall for the source database is disabled and the source database is a self-managed database that does not reside on an ECS instance, you can connect the source database and the destination database over the Internet.

    • If the firewall for the source database is enabled, you must allow requests from *.aliyuncs.com to ensure that the source database can communicate with the destination database.

Database version and other limits

  • The engine version of the destination database must be the same or later than the engine version of the source database:

    • 2019 > 2017 > 2016 > 2012 > 2008 R2 > 2005

    • Enterprise Edition (Developer) > Standard Edition > Web > Express

      Click to expand and view the migration relationships supported by each version

      Engine version of the source database

      Engine version of the RDS instance

      SQL Server Developer, SQL Server Standard, SQL Server Web, and SQL Server Express

      Enterprise Edition

      SQL Server Standard, SQL Server Web, and SQL Server Express

      Standard Edition

      Web/Express

      Web

  • Different RDS instance types support different numbers of databases. When migrating multiple databases, make sure to evaluate the number of databases supported by the target RDS instance to ensure that the number of migrated databases does not exceed the limit.

Other limits

  • During data migration, data can be incrementally written to the self-managed SQL Server database. We recommend that you do not write data to the self-managed SQL Server database during the workload switchover to prevent data inconsistency.

  • During incremental migration, the RDS instance becomes temporarily unavailable. Wait until the incremental migration task is complete and use the RDS instance after the workloads are switched over to the RDS instance.

  • When a physical migration task is in progress, you cannot back up databases. If you want to back up databases during physical migration, you must enable COPY_ONLY.

  • You can migrate a single database, multiple databases, or the entire instance.

  • Fields of the FileStream and FileTables types cannot be migrated.

  • Memory tables cannot be migrated.

  • The in-memory online transaction processing (OLTP) and mirroring features of SQL Server are incompatible with each other. If you enable in-memory databases for the source database, you must make sure that the destination database does not reside on an RDS instance that runs RDS High-availability Edition.

Scenario 1: Self-managed database with Internet access

1. Install the backup gateway (database server)

You need to first install the backup gateway on the server where the source self-managed database resides. This section describes how to install the backup gateway.

Preparations

You must assign the sysadmin role to the NT AUTHORITY\SYSTEM account. You can execute an SQL statement to assign the role:

Note

The default startup account for AliyunDBSAgent is NT AUTHORITY\SYSTEM.

ALTER SERVER ROLE [sysadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO

Usage notes

  • Make sure that the backup gateway is installed in the same region as the destination RDS instance.

  • AliyunDBSAgent sets the recovery model of the database that you want to migrate to Full.

    Note

    If the recovery mode is Full and data is continuously written to the database, the disk space of the source database is occupied. This may exhaust the disk space of the source database. To prevent this issue, you can execute ALTER DATABASE Database name SET RECOVERY Simple; to set the recovery model to Simple after the migration task is complete.

  1. Visit the Data Transmission Service (DTS) console.

  2. In the left-side navigation pane, click Data Migration and select a region at the top of the page.

  3. Click Create Task. On the Configure Source And Destination Databases page, select SQL Server > Physical Protocol, and then click Create Physical Protocol Gateway.

  4. In the Installation Command dialog box, configure the Region Of Backup Gateway and Network Type Of Backup Gateway parameters. Then, copy the gateway installation command and download the installation package.

    Note

    Select Public Network if you want to access the gateway over the Internet. Select ECS Private Network/VPC if you want to access the gateway over an Alibaba Cloud Express Connect circuit.

  5. Install the DBS backup gateway (AliyunDBSAgent) on a local Windows device or server.

    1. Double-click the setup.exe file in the downloaded file.

    2. Select the installation language, click OK, and then click Next.

    3. Read and accept the terms of the agreement, and click Next.

    4. Select DBS Backup Gateway and click Next.

    5. Select an installation directory, click Next, and then click OK.

    6. Select Backup Gateway Region, enter the AccessKey ID and AccessKey Secret, and then click Next.

      Important
      • Make sure that the region in which the backup gateway is installed is the same as the region of the RDS for SQL Server instance.

      • The AccessKey pair information is stored in the plaintext format in the .\config\dbs-agent.conf file of the installation directory.

    7. Confirm the component package that you want to install and click Next.

      The backup gateway starts to be installed. The installation takes about 1 to 5 minutes.

    8. Click Done.

      You can view the installation status of the gateway in the C:\Program Files\aliyun\dbs_agent\logs\agent.log installation directory. If information similar to the following figure is displayed, the gateway is installed.网关的进程心跳

  6. After the backup gateway is installed, click Installed in the Installation Command dialog box of the DTS console.

  7. Check whether the backup gateway is started.

    1. In the Run dialog box of Windows, enter services.msc and click OK.

      The service manager dialog box of the system appears.

    2. In the service manager dialog box, check whether the service is started. If the service is not started, right-click AliyunDBSAgent and select Start from the shortcut menu.

      Note

      By default, the system starts the backup gateway. You can also start and stop the AliyunDBSAgent service in the service manager.

  8. View the new backup gateway.

    On the Backup Gateways page of the Data Disaster Recovery console, click Refresh in the upper-right corner to view the new backup gateway.

    To go to the Backup Gateways page of the Data Disaster Recovery console, perform the following steps:

    1. Log on to Data Management (DMS) 5.0.

    2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Gateway.

      Note

      If you use the DMS console in normal mode, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Gateway in the top navigation bar.

    Note

    The name of the new backup gateway starts with DTS_.

2. Create a DTS migration task

  1. Visit the Data Transmission Service (DTS) console.

  2. In the left-side navigation pane, click Data Migration and select a region at the top of the page.

  3. Click Create Task and configure the source and destination databases.

    Category

    Parameter

    Description

    N/A

    Task Name

    Configure a task name that has business significance (no uniqueness requirement) for easy identification. You can also use the task name that is automatically generated by the system.

    Source Database

    Select Existing Connection

    If you have added the source database information to the Database Connection Management page of DTS, you can select the database from the drop-down list. This way, you do not need to enter the source database information again.

    Database Type

    Select SQL Server.

    Access Method

    Select Physical Protocol.

    Instance Region

    The region in which the self-managed SQL Server database resides.

    Physical Protocol Gateway (DBS Backup Gateway)

    Select the backup gateway that you installed in 1. Install the backup gateway (database server).

    Domain Name Or IP

    Default value: localhost.

    Port

    Enter the service port of the self-managed SQL Server database. Default value: 1433.

    Destination Database

    Select Existing Connection

    If you have added the destination database information to the Database Connection Management page of DTS, you can select the database from the drop-down list. This way, you do not need to enter the destination database information again.

    Database Type

    Default value: SQL Server.

    Access Method

    Default value: Alibaba Cloud Instance.

    Instance Region

    The region in which the RDS for SQL Server instance resides.

    Instance ID

    The ID of the RDS for SQL Server instance.

    Database Account

    Enter the account of the RDS for SQL Server instance. The account must have read and write permissions.

    Database Password

    Enter the password of the account that is used to connect to the database of the destination RDS instance.

    Connection Method

    • If Secure Sockets Layer (SSL) encryption is disabled for the destination database, select Non-encrypted.

    • If SSL encryption is enabled for the destination database, select SSL-encrypted. DTS automatically trusts the server certificate.

  4. After you complete the configuration, click Test Connectivity and Proceed at the bottom of the page.

    Important

    Make sure that you have added the CIDR blocks of DTS servers to the whitelist of the self-managed SQL Server database. Adding the CIDR blocks of DTS servers may pose security risks. Make sure that you have implemented security measures such as enhancing password strength and limiting ports.

  5. Configure the objects for the task.

    Parameter

    Description

    Task Stages

    • If you want to perform only full data migration, select Full Data Migration. Full Data Migration is selected by default.

    • To ensure business continuity during data migration, select Full Data Migration and Incremental Data Migration.

    Note

    If you do not select Incremental Data Migration, we recommend that you do not write data to the source instance during data migration to ensure data consistency.

    Source Objects

    Select one or more objects from the Source Objects section. Click the 向右小箭头 icon to add the objects to the Selected Objects section.

    Note

    You can migrate a single database, multiple databases, or the entire instance.

    Selected Objects

    The objects that you want to migrate.

  6. Click Next: Advanced Settings to configure advanced settings.

    Parameter

    Description

    Monitoring and Alerting

    Specifies whether to configure alerting for the data migration task. If the task fails or the migration latency exceeds the specified threshold, the alert contacts receive notifications. Valid values:

    Retry Time For Failed Connections

    The retry time range for failed connections. If the source or destination database fails to be connected after the data migration task is started, DTS immediately retries a connection within the retry time range. Valid values: 10 to 1,440. Unit: minutes. Default value: 720. We recommend that you set the parameter to a value greater than 30. If DTS is reconnected to the source and destination databases within the specified retry time range, DTS resumes the data migration task. Otherwise, the data migration task fails.

    Note
    • If you specify different retry time ranges for multiple data migration tasks that share the same source or destination database, the value that is specified later takes precedence.

    • When DTS retries a connection, you are charged for the DTS instance. We recommend that you specify the retry time range based on your business requirements. You can also release the DTS instance at the earliest opportunity after the source database and destination instance are released.

  7. In the lower-right corner of the page, click Next: Save Task Settings and Precheck.

    Note
    • DTS performs a precheck before a data migration task starts. You can start a data migration task only after the task passes the precheck.

    • If the precheck fails, click View Details next to the failed item, fix the issue based on the instructions, and then run the precheck again.

    • If an alert is generated during the precheck:

      • For items that cannot be ignored, click View Details next to the failed item, fix the issue based on the instructions, and then run the precheck again.

      • For items that can be ignored without fixing, click View Alert Details, Confirm And Ignore, OK, and Run Precheck Again in sequence to skip the alert item and run the precheck again. If you ignore the alert item, data inconsistency may occur and your business may be exposed to potential risks.

  8. Success Rate 100% Next: Purchase InstanceYou can migrate your workloads to the RDS for SQL Server instance.

  9. On the Purchase page, read and select Data Transmission Service (Pay-as-you-go) Terms Of Service.

  10. Click Buy And Start, and in the OK dialog box that appears, click OK.

    You can click the target migration instance on the Data Migration page, and on the Task Management page, view the migration progress.

    Note

    You can also view the progress of full or incremental migration on the Backup And Restoration > Backup Data Upload History page of the destination instance in the RDS console.

  11. When the full migration task progress reaches 100% and the incremental migration task is in progress, go to the Task Management > Incremental Migration page of the target migration task, and click the Migrate To Cloud button.

  12. In the Are You Sure You Want To Migrate To The Cloud dialog box, click Switch Now and wait until the migration task is complete.

    Important

    To ensure data consistency, stop writing data to the source instance before you trigger the workload switchover. Wait for the migration task to complete and then switch over your business connections. The entire process requires several minutes.

Scenario 2: Self-managed database without public network access but with a bastion host

1. Install a proxy gateway (bastion host)

The following sections describe how to install a proxy gateway on a bastion host that runs Windows or Linux.

Prerequisites

You need to grant the NT AUTHORITY\SYSTEM account the Sysadmin role. You can execute the following SQL command to set it up:

Note

The default startup account for AliyunDBSAgent is NT AUTHORITY\SYSTEM.

ALTER SERVER ROLE [sysadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO

Usage notes

  • Make sure that the proxy gateway and backup gateway are installed in the same region as the destination RDS instance.

  • AliyunDBSAgent sets the recovery model of the database that you want to migrate to Full.

    Note

    If the recovery model is Full and data is continuously written to the database, the disk space of the source database is occupied. This may exhaust the disk space of the source database. To prevent this issue, we recommend that you execute ALTER DATABASE Database name SET RECOVERY Simple; to set the recovery model to Simple after a data migration task is complete.

Windows operating system

  1. Visit the Data Transmission Service (DTS) console.

  2. In the left-side navigation pane, click Data Migration and select a region in the top navigation bar.

  3. Click Create Task. On the Configure Source And Destination Databases page, select SQL Server > Physical Protocol, and then click Create Physical Protocol Gateway.

  4. In the Installation Command dialog box, configure the Region Of Backup Gateway and Network Type Of Backup Gateway parameters. Then, copy the gateway installation link and download the installation package.

    Important
    • Make sure to save this link separately for later use in Step 2: Install a backup gateway (database host).

    • If you want to access the gateway over the Internet, select Public Network. If you want to access the gateway over an Alibaba Cloud Express Connect circuit, select ECS Private Network/VPC.

  5. Install a proxy gateway on the Windows bastion host.

    1. Double-click the setup.exe file in the downloaded file.

    2. Select an installation language and click OK.

    3. Click Next.

    4. Read and accept the terms of the agreement and click Next.

    5. Select Proxy Gateway and click Next.

    6. Select an installation path for the proxy gateway, click Next, and then click Yes.

      Note

      By default, the proxy gateway is installed in C:\Program Files (x86)\aliyun\dbs_agent.

    7. Click Next to prepare for the installation of the proxy gateway base file.

    8. After the base file is installed, click Next > Done.

  6. Open the Task Manager in Windows to check whether the proxy gateway is installed.

  7. After the proxy gateway is installed on the bastion host, you need to install a backup gateway on the database host.

Linux operating system

You need to go to the Data Disaster Recovery console to obtain the download link for the proxy gateway and install the proxy gateway on the Linux bastion host.

  1. Log on to Data Management (DMS) 5.0.

  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Gateway.

    Note

    If you use the DMS console in normal mode, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Gateway in the top navigation bar.

  3. Click Install Backup Gateway in the upper-right corner of the page.

  4. Select Network Type Of Backup Gateway, copy the backup gateway installation command, and then run the installation command on the database server.

    Important
    • Make sure to save this link separately for later use in Step 2: Install a backup gateway (database host).

    • If you want to access the gateway over the Internet, select Public Network. If you want to access the gateway over an Alibaba Cloud Express Connect circuit, select ECS Private Network/VPC.

    1. Run the installation command in the Linux CLI. The system downloads and runs the installation package. The following sample code provides an example:

      
      [root@iZbp****** ~]# wget -O aliyunDBSAgentInstaller.jar https://aliyun-dbs.oss-cn-hangzhou-internal.aliyuncs.com/installer/0.0.141/aliyunDBSAgentInstaller-0.0.141.jar && sudo java -Dregion=cn-hangzhou -jar aliyunDBSAgentInstaller.jar
      --2023-08-25 16:04:52--  https://aliyun-dbs.oss-cn-hangzhou-internal.aliyuncs.com/installer/0.0.141/aliyunDBSAgentInstaller-0.0.141.jar
      Resolving aliyun-dbs.oss-cn-hangzhou-internal.aliyuncs.com (aliyun-dbs.oss-cn-hangzhou-internal.aliyuncs.com)... 100.XXX.XX.XX, 100.XXX.XX.XX, 100.XXX.XX.XX, ...
      Connecting to aliyun-dbs.oss-cn-hangzhou-internal.aliyuncs.com (aliyun-dbs.oss-cn-hangzhou-internal.aliyuncs.com)|100.XXX.XX.XX|:443... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 247955671 (236M) [application/x-java-archive]
      Saving to: 'aliyunDBSAgentInstaller.jar'
      
      100%[=======================================================================================================>] 247,955,671 19.9MB/s   in 11s    
      
      2023-08-25 16:05:03 (21.4 MB/s) - 'aliyunDBSAgentInstaller.jar' saved [247955671/247955671]
    2. Select an installation language. Enter 0 to select Chinese. Enter 1 to select English.

      Select your language
      0  [x] chn
      1  [ ] eng
      Input selection: 
      0
    3. Enter 1 and read the gateway protocol.

      Press 1 to continue, 2 to quit, 3 to redisplay
      1
    4. Enter 1 to agree to the gateway protocol.

      Press 1 to accept, 2 to reject, 3 to redisplay
      1
    5. Select the component that you want to install. If you enter Y, the component is a backup gateway (Agent). If you enter N, the component is a proxy gateway (database gateway DG). In this example, a proxy gateway is installed. Enter N and then enter Y to confirm the component information.

      Enter Y for Yes, N for No: 
      N
      --
      DG
      --
      Enter Y for Yes, N for No: 
      Y
      Done!
    6. Enter 1 to continue the installation.

      Press 1 to continue, 2 to quit, 3 to redisplay
      1
    7. Select an installation path. Press Enter to install the proxy gateway in the default path /usr/local/aliyun/dbs_agent.

      If you want to use a custom path, enter the custom path and enter 1 to confirm it. In this example, the proxy gateway is installed in the /usr/local/aliyun/daili_dbs_agent directory.

      Select installation path: [/usr/local/aliyun/dbs_agent] 
      /usr/local/aliyun/daili_dbs_agent
      
      Press 1 to continue, 2 to quit, 3 to redisplay
      1
    8. Confirm the component that you want to install, and then enter 1 to start the installation.

      The installation takes about one to five minutes to complete.

      Select the package you want to install:
      
        [x] Pack 'Proxy gateway base file' required
      Done!
      
      Press 1 to continue, 2 to quit, 3 to redisplay
      1
      
      ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      Installing
      ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      
      ====================
      Installation started
      
      Platform: linux,version=3.10.0-1XXX.XX.X.el7.x86_64,arch=x64,symbolicName=null,javaVersion=1.8.0_372
      [ Starting to unpack ]
      [ Processing package: Proxy gateway base file (1/1) ]
      Cleaning up the target folder ...
      [ Unpacking finished ]
      Installation finished
      
      ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      Installed
      ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      
      Installation was successful
      Application installed on /usr/local/aliyun/daili_dbs_agent
      [ Writing the uninstaller data ... ]
      [ Console installation done ]
  5. Run the following command to check whether the proxy gateway is installed:

    ps aux | grep app_aliyun_proxy

    The following command output indicates that the proxy gateway is installed. If an error occurs and you cannot resolve the error, join the Data Disaster Recovery DingTalk group (group ID: 35585947) for assistance.

    [root@iZbp****** ~]# ps aux | grep app_aliyun_proxy
    root     1****  0.0  0.5 7*****  9*** ?        Ssl  16:06   0:00 /usr/local/aliyun/daili_dbs_agent/dist/app_aliyun_proxy/app_aliyun_proxy -addr :9797 -logdir /usr/local/aliyun/daili_dbs_agent/logs
    root     2****  0.0  0.0 1*****   9** pts/1    S+   16:08   0:00 grep --color=auto app_aliyun_proxy

  6. After the proxy gateway is installed on the bastion host, you need to install a backup gateway on the database host.

2. Install a backup gateway (database host)

Install a DBS backup gateway on the server where the self-managed database is deployed and specify the IP address of the proxy gateway (the internal IP address of the bastion host) during the installation.

  1. Copy the gateway download link from Step 4 in 1. Install a proxy gateway (bastion host) and download the gateway on the server where the self-managed database is deployed.

    Important

    The backup gateway download link must be the same as the link in Step 4 of Install a proxy gateway. Otherwise, the database host cannot connect to the external network.

  2. Install the DBS backup gateway (AliyunDBSAgent) on a local Windows device or server.

    1. Double-click the setup.exe file in the downloaded file.

    2. Select the installation language, click OK, and then click Next.

    3. Read and accept the terms of the agreement, and click Next.

    4. Select DBS Backup Gateway and click Next.

    5. Select an installation directory, click Next, and then click OK.

    6. Select Agent Region and specify AccessKey ID, AccessKey Secret, Proxy Gateway Address, and Proxy Gateway Port. Then, click Next.

      Important
      • Make sure that the region in which the DBS backup gateway is installed is the same as the region of the destination RDS instance.

      • The AccessKey pair information is stored in the plaintext format in the .\config\dbs-agent.conf file of the installation directory.

      • For Proxy Gateway Address, enter the IP address of the proxy gateway (the internal IP address of the bastion host). For Proxy Gateway Port, the default value is 9797.

      After the configuration is complete, the system attempts to connect to the proxy gateway that is configured in Step 1. If the connection fails, the system reports an error. In this case, check the installation of the proxy gateway.

    7. Confirm the component package that you want to install and click Next.

      The backup gateway starts to be installed. The installation takes about 1 to 5 minutes.

    8. Click Done.

      You can view the installation status of the gateway in the C:\Program Files\aliyun\dbs_agent\logs\agent.log installation directory. If information similar to the following figure is displayed, the gateway is installed.网关的进程心跳

  3. After the DBS backup gateway is installed, click Installed in the Installation Command dialog box of the DTS console.

  4. Check whether the DBS backup gateway is started.

    1. In the Run dialog box of Windows, enter services.msc and click OK.

      The service manager dialog box of the system appears.

    2. In the service manager dialog box, check whether the service is started. If the service is not started, right-click AliyunDBSAgent and select Start from the shortcut menu.

      Note

      By default, the system starts the backup gateway. You can also start and stop the AliyunDBSAgent service in the service manager.

  5. View the new DBS backup gateway.

    On the Backup Gateways page of the Data Disaster Recovery console, click Refresh in the upper-right corner to view the new DBS backup gateway.

    To go to the Backup Gateways page of the Data Disaster Recovery console, perform the following steps:

    1. Log on to Data Management (DMS) 5.0.

    2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Gateway.

      Note

      If you use the DMS console in normal mode, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Gateway in the top navigation bar.

    Note

    The name of the new DBS backup gateway starts with DTS_.

3. Create a DTS migration task

  1. Visit the Data Transmission Service (DTS) console.

  2. In the left-side navigation pane, click Data Migration and select a region in the top navigation bar.

  3. Click Create Task and configure the source and destination databases.

    Section

    Parameter

    Description

    N/A

    Task Name

    Enter a task name that helps identify the task. The task name does not need to be unique. You can also use the default task name that is generated by the system.

    Source Database

    Select Existing Connection

    If you have added the source database to the DTS Database Connection Management page, you can select the database from the drop-down list. This way, you do not need to manually enter the information about the source database.

    Database Type

    Select SQL Server.

    Access Method

    Select Physical Protocol.

    Instance Region

    The region in which the self-managed SQL Server database resides.

    Physical Protocol Gateway (DBS Backup Gateway)

    Select the DBS backup gateway that is installed in 2. Install a backup gateway (database host).

    Domain Name Or IP

    Default value: localhost.

    Port

    The port number of the self-managed SQL Server database. Default value: 1433.

    Destination Database

    Select Existing Connection

    If you have added the destination database to the DTS Database Connection Management page, you can select the database from the drop-down list. This way, you do not need to manually enter the information about the destination database.

    Database Type

    Default value: SQL Server.

    Access Method

    Default value: Alibaba Cloud Instance.

    Instance Region

    The region in which the RDS instance resides.

    Instance ID

    The ID of the RDS instance.

    Database Account

    The username of the account of the RDS instance. The account must have read and write permissions.

    Note

    You can create a standard account or a privileged account for the RDS instance in the ApsaraDB RDS console and modify the permissions of the account as needed.

    Database Password

    The password of the account.

    Connection Method

    • If Secure Sockets Layer (SSL) encryption is disabled for the destination database, select Non-encrypted.

    • If SSL encryption is enabled for the destination database, select SSL-encrypted. By default, DTS trusts the server certificate.

  4. After the configuration is complete, click Test Connectivity and Proceed at the bottom of the page.

    Important

    Make sure that you have added the IP addresses of DTS servers to the whitelist of the self-managed SQL Server database. Adding the IP addresses of DTS servers may pose security risks. Make sure that you take security measures, such as enhancing the password strength and limiting the port range.

  5. Select objects for the task.

    Parameter

    Description

    Task Stages

    • If you want to perform only full data migration, select Full Data Migration. Full Data Migration is selected by default.

    • To ensure business continuity during data migration, select Full Data Migration and Incremental Data Migration.

    Note

    If you do not select Incremental Data Migration, we recommend that you do not write data to the source database during data migration to ensure data consistency.

    Source Objects

    Select one or more objects from the Source Objects section. Click the 向右小箭头 icon to add the objects to the Selected Objects section.

    Note

    You can migrate a single database, multiple databases, or the entire instance.

    Selected Objects

    The objects that you want to migrate.

  6. Click Next: Advanced Settings to configure advanced settings.

    Parameter

    Description

    Monitoring and Alerting

    Specifies whether to configure alerting for the data migration task. If the task fails or the migration latency exceeds the specified threshold, the alert contacts receive notifications. Valid values:

    Retry Time For Failed Connections

    The retry time range for failed connections. If the source or destination database fails to be connected after the data migration task is started, DTS immediately retries a connection within the retry time range. Valid values: 10 to 1,440. Unit: minutes. Default value: 720. We recommend that you set the parameter to a value greater than 30. If DTS is reconnected to the source and destination databases within the specified retry time range, DTS resumes the data migration task. Otherwise, the data migration task fails.

    Note
    • If you specify different retry time ranges for multiple data migration tasks that share the same source or destination database, the value that is specified later takes precedence.

    • When DTS retries a connection, you are charged for the DTS instance. We recommend that you specify the retry time range based on your business requirements. You can also release the DTS instance at the earliest opportunity after the source database and destination instance are released.

  7. After you complete the preceding configurations, click Next: Save Task Settings and Precheck in the lower-right corner of the page.

    Note
    • DTS performs a precheck before a data migration task starts. You can start a data migration task only after the task passes the precheck.

    • If the precheck fails, click View Details next to the failed check item, and fix the issue according to the instructions before running the precheck again.

    • If an alert is generated for an item during the precheck, perform the following operations based on the scenario:

      • For check items that cannot be ignored, click View Details after the failed check item, and fix the issue according to the prompts before running the precheck again.

      • For check items that can be ignored without fixing, you can click View Alert Details, Confirm Ignore, OK, and Run Precheck Again in sequence to skip the alert check items and run the precheck again. If you ignore the alert item, data inconsistency may occur and your business may be exposed to potential risks.

  8. When Success Rate shows 100%, click Next: Purchase Instance.

  9. On the Purchase page, read and select Data Transmission Service (Pay-as-you-go) Terms Of Service.

  10. Click Buy And Start, and in the OK dialog box that appears, click OK.

    You can click the target migration instance on the data migration interface, and view the instance migration progress on the Task Management page.

    Note

    You can also view the progress of full migration or incremental migration tasks on the Backup And Restoration > Backup Data Upload History page of the destination instance in the RDS console.

  11. When the full migration task progress reaches 100% and the incremental migration task is in progress, go to the Task Management > Incremental Migration page of the target migration task, and click the Migrate To Cloud button.

  12. In the Do You Want To Migrate To Cloud dialog box, click Start Now and wait for the migration task to complete.

    Important

    To ensure data consistency, stop writing data to the source instance before you trigger the workload switchover. Wait for the migration task to complete and then switch over business connections. The entire process requires several minutes.

Appendix: Comparison between physical gateway-based migration and logical data migration

Item

Backup gateway migrationBackup gateway migration to cloud

Logical data migration

Migration principle

The native physical backup protocol is used to write data to the destination database as data blocks.

The JDBC protocol is used to obtain SQL statements and write the statements to the destination database.

Operating system requirements

Only SQL Server on Windows is supported. The version of the desktop operating system cannot be earlier than Windows XP. The version of the server operating system cannot be earlier than Windows Server 2003.

No limits.

Deployment requirements

A physical protocol gateway must be installed on the server on which the database resides.

You do not need to install a gateway.

Network connectivity

Whether the server on which the self-managed database is deployed can connect to the network of Alibaba Cloud. Suitable solutions are provided based on the current network status:

The port to connect to the database must be enabled, or leased line-based connections must be established.

Source database permissions

The sysadmin role is required.

The SELECT permission is required for schema migration and full migration. The sysadmin permission is required for incremental migration. For more information, see Permissions required for database accounts.

Destination database version

The engine version of the destination database must be the same or later than the engine version of the source database.

Supports migration between versions, whether upgrading to higher versions or downgrading to lower versions.

Destination database accessibility

The destination database is inaccessible during data migration.

You can read data from or write data to the destination database during data migration.

Limits on tables that can be migrated from the source database

Memory tables cannot be migrated. Fields of the FileStream and FileTables types cannot be migrated.

For more information, see Limits on the source database.

Migration scenarios

Data can be migrated from self-managed databases to the cloud.

Note

The self-managed SQL Server databases can reside on ECS instances, in data centers, or on third-party cloud servers.

Data can be migrated from self-managed databases or cloud-hosted databases to the cloud.

Migration efficiency

High.

Medium.

Data processing extract, transform, load (ETL)

Not supported.

Supported.

Table-level data filtering

Not supported.

Supported.

Database-level data filtering

Supported.

Supported.