This topic describes how to use the physical gateway-based migration feature on the Data Transmission Service (DTS) console to migrate a self-managed SQL Server database from an ECS instance, a data center, or another cloud server to ApsaraDB RDS for SQL Server. DTS supports two network scenarios based on how the source server is accessed: directly over the public network or through a bastion host. Built on a physical gateway protocol, this feature offers high transfer speeds, ease of use, and high stability. Its adaptability to various network environments significantly improves migration efficiency.
Choose a migration plan
Choose a migration plan based on your network environment. For more information, see Appendix: Differences between backup gateway migration and logical data migration.
|
Migration plan |
Description |
|
|
|
Prerequisites
The prerequisites vary by migration scenario. Review the requirements for your selected scenario.
Scenario 1: With public access
-
The source self-managed SQL Server database must be one of the following versions: SQL Server 2019, 2017, 2016, 2014, 2012, 2008 R2, or 2005.
NoteSelf-managed databases on ECS instances, in data centers, or on third-party cloud servers are supported. Cloud databases are not supported.
-
The target RDS for SQL Server instance must meet the following requirements:
-
The target database must be one of the following versions: SQL Server 2019, 2017, 2016, 2014, 2012, or 2008 R2.
-
The version of the target RDS for SQL Server instance must be greater than or equal to the version of the source self-managed SQL Server database.
-
-
Use your Alibaba Cloud account to complete the following authorization tasks:
-
Create an AccessKey and obtain the Access Key ID and Access Key Secret. These credentials are used for identity verification and to register the client gateway.
-
If you want to use a RAM user, grant the AliyunDBSFullAccess permission to the RAM user.
-
Scenario 2: Without public access
-
The source self-managed SQL Server database must meet the following requirements:
-
The source self-managed SQL Server database must be one of the following versions: SQL Server 2019, 2017, 2016, 2014, 2012, 2008 R2, or 2005.
NoteSelf-managed databases on ECS instances, in data centers, or on third-party cloud servers are supported. Cloud databases are not supported.
-
On the server that hosts the source self-managed database, do not set the
HTTP_PROXYandHTTPS_PROXYenvironment variables.ImportantIf these environment variables are set, the system prioritizes the proxy gateway specified by the variables. This overrides the database gateway you install on the bastion host in Step 1 and causes a network connection failure.
-
-
The target RDS for SQL Server instance must meet the following requirements:
-
The target database must be one of the following versions: SQL Server 2019, 2017, 2016, 2014, 2012, or 2008 R2.
-
The version of the target RDS for SQL Server instance must be greater than or equal to the version of the source self-managed SQL Server database.
-
-
If the bastion host runs Linux, install JRE (Java Runtime Environment) version 1.8 on the bastion host. You can download it from the official website.
-
Use your Alibaba Cloud account to complete the following authorization tasks:
-
Create an AccessKey and obtain the Access Key ID and Access Key Secret. These credentials are used for identity verification and to register the client gateway.
-
If you want to use a RAM user, grant the AliyunDBSFullAccess permission to the RAM user.
-
Limitations
Review the following limitations before using DTS to migrate data. Ignoring them can cause the migration to fail or report errors.
Source database limitations
-
DTS supports only SQL Server running on Windows. The desktop version must be Windows XP or later, and the server version must be Windows Server 2003 or later.
-
The size of the source database cannot exceed the available storage space of the target RDS for SQL Server instance. Otherwise, the migration will fail.
-
The name of the source database cannot be the same as the name of any database on the target instance.
-
The name of the source database cannot be the same as a system database name or other reserved database names, such as:
reserved_dbname = ["master", "tempdb", "msdb", "model", "distribution","rdscore","sys_info"] -
The source SQL Server must meet the following network requirements:
-
If the source is a self-managed database on an Alibaba Cloud ECS instance with its firewall disabled, you can connect to it over a VPC or the Internet.
-
If the source is not a self-managed database on an Alibaba Cloud ECS instance and its firewall is disabled, you can connect to it only over the Internet.
-
If a firewall is enabled for the source database, you must add
*.aliyuncs.comto the allowlist to ensure network connectivity.
-
Version and edition limitations
-
The database engine version of the target SQL Server instance must be the same as or later than that of the source SQL Server. The version hierarchy is as follows:
-
2019 > 2017 > 2016 > 2014 > 2012 > 2008 R2 > 2005
-
Enterprise (Developer) > Standard > Web > Express
-
-
The maximum number of databases an RDS instance supports varies by its specification. Before migrating multiple databases, verify that the number of databases to migrate does not exceed the target instance's limit.
Other limitations
-
You can perform incremental write operations on the source self-managed SQL Server database during data migration. However, do not perform write operations during the cutover to prevent data inconsistency.
-
During an incremental migration, the target RDS for SQL Server database is temporarily unavailable. The target database remains unavailable until the migration and cutover are complete.
-
During a physical migration, do not perform other database backup operations unless they are started with the COPY_ONLY option enabled.
-
You can migrate a single database, multiple databases, or an entire instance.
-
DTS does not support migrating FileStream and FileTables data.
-
DTS does not support migrating memory tables.
-
In SQL Server, the In-Memory OLTP and Mirroring features are incompatible. If your source database has an in-memory database enabled, the target instance cannot be an RDS High-availability Edition instance.
Scenario 1: Self-hosted database with public access
1. Install the backup gateway on the host
You must first install a backup gateway on the server that hosts your source self-hosted database.
-
Go to the Data Transmission Service (DTS) console.
-
In the left-side navigation pane, click Data Migration. In the top navigation bar, select a region.
-
Click Create Task. On the Configure Source and Destination Databases page, select , and then click Create Physical Protocol Gateway.
-
In the Installation Command dialog box, select a Region of Backup Gateway and a Network Type of Backup Gateway, copy the gateway installation command, and manually download the package.
NoteSelect Public for access over the public network. Select ECS Private Network/VPC for access over Express Connect or a VPC.
-
Install the backup gateway (AliyunDBSAgent) on your local Windows device or server.
-
In the downloaded folder, double-click setup.exe.
-
Select an installation language, click OK, and then click Next.
-
Read and accept the agreement, and then click Next.
-
Select DBS Backup Gateway, and then click Next.
-
Select an installation path, click Next, and then click OK.
-
Select a Backup Gateway Region, enter your Access Key ID and Access Key Secret, and then click Next.
Important-
Ensure that the backup gateway is installed in the same region as the target ApsaraDB RDS for SQL Server instance.
-
The AccessKey information is stored in plaintext in the
.\config\dbs-agent.conffile in the installation directory.
-
-
Confirm the component packages and click Next.
The backup gateway installation starts. The process takes 1 to 5 minutes.
-
Click Done.
You can verify the installation status in the
C:\Program Files\aliyun\dbs_agent\logs\agent.logfile. The gateway is successfully installed if the log contains entries similar to the following example. This log shows the gateway sending a heartbeat request every 10 seconds.2021-01-05 00:00:01 INFO KeepAliveActor:100 - start process tick tock request with id 377119 2021-01-05 00:00:01 INFO KeepAliveActor:224 - processed keep alive message with request id 377119 2021-01-05 00:00:11 INFO KeepAliveActor:100 - start process tick tock request with id 377120 2021-01-05 00:00:11 INFO KeepAliveActor:224 - processed keep alive message with request id 377120 2021-01-05 00:00:21 INFO KeepAliveActor:100 - start process tick tock request with id 377121 2021-01-05 00:00:21 INFO KeepAliveActor:224 - processed keep alive message with request id 377121 2021-01-05 00:00:31 INFO KeepAliveActor:100 - start process tick tock request with id 377122 2021-01-05 00:00:31 INFO KeepAliveActor:224 - processed keep alive message with request id 377122 2021-01-05 00:00:41 INFO KeepAliveActor:100 - start process tick tock request with id 377123 2021-01-05 00:00:41 INFO KeepAliveActor:224 - processed keep alive message with request id 377123 2021-01-05 00:00:51 INFO KeepAliveActor:100 - start process tick tock request with id 377124 2021-01-05 00:00:51 INFO KeepAliveActor:224 - processed keep alive message with request id 377124 2021-01-05 00:01:01 INFO KeepAliveActor:100 - start process tick tock request with id 377125 2021-01-05 00:01:01 INFO KeepAliveActor:224 - processed keep alive message with request id 377125 2021-01-05 00:01:11 INFO KeepAliveActor:100 - start process tick tock request with id 377126 2021-01-05 00:01:11 INFO KeepAliveActor:224 - processed keep alive message with request id 377126 2021-01-05 00:01:21 INFO KeepAliveActor:100 - start process tick tock request with id 377127 2021-01-05 00:01:21 INFO KeepAliveActor:224 - processed keep alive message with request id 377127 2021-01-05 00:01:31 INFO KeepAliveActor:100 - start process tick tock request with id 377128 2021-01-05 00:01:31 INFO KeepAliveActor:224 - processed keep alive message with request id 377128 2021-01-05 00:01:41 INFO KeepAliveActor:100 - start process tick tock request with id 377129 2021-01-05 00:01:41 INFO KeepAliveActor:224 - processed keep alive message with request id 377129
-
-
After you install the backup gateway, return to the Installation Command dialog box on the DTS console and click Installed.
-
Verify that the backup gateway has started.
-
In the Windows Run dialog box, enter
services.mscand click OK. -
In Service Manager, check whether the service has started. If not, right-click AliyunDBSAgent and select Start from the shortcut menu.
NoteThe backup gateway starts by default. You can also start or stop the AliyunDBSAgent service in Service Manager.
-
-
View the newly added backup gateway.
On the Backup Gateway page of Database Backup (DBS), click Refresh in the upper-right corner to view the newly added backup gateway.
NoteThe name of the newly added backup gateway starts with
DTS_.
2. Create a DTS migration task
-
Go to the Data Transmission Service (DTS) console.
-
In the left-side navigation pane, click Data Migration. In the top navigation bar, select a region.
-
Click Create Task and configure the source and target databases.
Category
Parameter
Description
N/A
Task Name
Specify a descriptive name for the task for easier identification. The name does not need to be unique. You can also use the default name that the system generates.
Source Database
Select Existing Connection
If you have saved the source database connection information in DTS Data Connection Management, you can select it from the drop-down list to autofill the connection settings.
Database Type
Select SQL Server.
Connection Type
Select Physical Protocol.
Instance Region
The region where the self-hosted SQL Server database is located. This is selected by default.
Physical Protocol Gateway (DBS Backup Gateway)
Select the backup gateway that you installed in 1. Install the backup gateway on the host.
Domain Name or IP
The default value is localhost.
Port
Enter the port number of the self-hosted SQL Server database. The default value is 1433.
Destination Database
Select Existing Connection
If you have saved the target database connection information in DTS Data Connection Management, you can select it from the drop-down list to autofill the connection settings.
Database Type
The default value is SQL Server.
Connection Type
The default value is Alibaba Cloud Instance.
Instance Region
Select the region where the target ApsaraDB RDS for SQL Server instance is located.
Instance ID
Select the ID of the target ApsaraDB RDS for SQL Server instance.
Database Account
Enter the database account for the target ApsaraDB RDS for SQL Server instance. This account must have read and write permissions.
NoteOn the ApsaraDB RDS console, you can create a standard or privileged account and modify account permissions as needed.
Database Password
Enter the password for the database account.
Connection Method
-
If SSL encryption is not enabled for the target database, select Non-encrypted.
-
If SSL encryption is enabled for the target database, select SSL-encrypted. DTS trusts the server-side certificate by default.
-
-
Click Test Connectivity and Proceed.
ImportantAdd the DTS server IP addresses displayed in the dialog box to the allowlist of your self-hosted SQL Server database. Adding DTS IP addresses to an allowlist can introduce security risks. Evaluate the risks and implement protective measures, such as using strong passwords and restricting access to specific ports.
-
Configure the objects to migrate.
Parameter
Description
Task Step
-
To perform only a full migration, select Full Data Migration. This type is required and selected by default.
-
To perform a migration with minimal downtime, select both Full Data Migration and Incremental Data Migration.
NoteIf you do not select Incremental Data Migration, do not write new data to the source instance during the data migration to ensure data consistency.
Source Objects
In the Source Objects box, click the objects that you want to migrate, and then click the
icon to move them to the Selected Objects box.NoteYou can migrate a single database, multiple databases, or an entire instance.
Selected Objects
Displays the objects to be migrated.
-
-
Click Next: Advanced Settings to configure advanced parameters.
Parameter
Description
Monitoring and Alerting
Select whether to set alerts and receive alert notifications based on your business needs.
-
No: Does not set an alert.
-
Yes: Configure alerts by setting an alert threshold and an alert contact. If a migration fails or the latency exceeds the threshold, the system sends an alert notification.
Retry Time for Failed Connections
After the migration task starts, if the connection to the source or destination database fails, DTS reports an error and immediately begins to retry the connection. The default retry duration is 720 minutes. You can customize the retry time to a value from 10 to 1440 minutes. We recommend that you set the duration to more than 30 minutes. If DTS reconnects to the source and destination databases within the specified duration, the migration task automatically resumes. Otherwise, the task fails.
Note-
For multiple DTS instances that share the same source or destination, the network retry time is determined by the setting of the last created task.
-
Because you are charged for the task during the connection retry period, we recommend that you customize the retry time based on your business needs, or release the DTS instance as soon as possible after the source and destination database instances are released.
-
-
After you complete the configurations, click Next: Save Task Settings and Precheck in the lower-right corner of the page.
Note-
DTS performs a precheck before the migration task starts. The task begins only after the precheck is successful.
-
If the precheck fails, click View Details next to the failed check item. Fix the issue based on the cause and run the precheck again.
-
If a warning is reported during the precheck:
-
For items that cannot be ignored, click View Details next to the failed check item. Fix the issue based on the cause and run the precheck again.
-
For items that can be ignored, click Confirm Alert Details, Ignore, and then OK. Then, click Precheck Again to skip the warning item and run the precheck again. Ignoring a warning item may lead to data inconsistencies and other business risks.
-
-
-
When the Success Rate is 100%, click Next: Purchase Instance.
-
On the buy page, read and select the Data Transmission Service (Pay-as-you-go) Service Terms checkbox.
-
Click Buy and Start. In the OK dialog box, click OK.
On the Data Migration page, you can click the migration task and view the migration progress on the Task Management page.
NoteYou can also view the full or incremental migration progress on the ApsaraDB RDS console on the page of the target instance.
-
After the full migration progress reaches 100% and while the incremental migration is running, go to the page of the migration task and click the Migration to Cloud button.
-
In the Are you sure you want to switch to the cloud? dialog box, click Start Now and wait for the migration task to complete.
ImportantTo ensure data consistency, stop writing data to the source instance before you initiate the switchover. Wait for the switchover task to complete, and then switch your business connection to the target instance. This process takes several minutes.
Scenario 2: Access a database via a bastion host
1. Install proxy gateway on a bastion host
This section shows you how to install the proxy gateway on a bastion host that runs Windows or Linux.
Windows
-
Go to the DTS console.
-
In the navigation pane on the left, click Data Migration. In the top navigation bar, select a region.
-
Click Create Task. On the Configure Source and Destination Databases page, select , and then click Create Physical Protocol Gateway.
-
In the Installation Command dialog box, select a Region of Backup Gateway and a Network Type of Backup Gateway. Then, copy the gateway installation link and use it to download the installer.
Important-
Save this link. You will need this link for Step 2: Install the backup gateway (database host).
-
If you access the source database over a public IP address, select Public. If you access the source database over Alibaba Cloud Express Connect, select ECS Private Network/VPC.
-
-
Install the proxy gateway on the Windows bastion host.
-
In the downloaded file, double-click the
setup.exeapplication. -
Select an installation language and click OK.
-
Click Next.
-
Read and accept the terms of the agreement and click Next.
-
Select proxy gateway and click Next.
-
Select an installation path for the proxy gateway, click Next, and then click OK.
NoteBy default, the gateway is installed in
C:\Program Files (x86)\aliyun\dbs_agent. -
Click Next to install the proxy gateway base files.
-
After the base files are installed, click .
-
-
Open Windows Task Manager to verify that the proxy gateway is running.
If the following process is running, the proxy gateway is installed successfully.
-
After installing the proxy gateway on the bastion host, install the backup gateway on the database host.
Linux
This procedure shows you how to get the download link from the DBS console and install the proxy gateway on the Linux bastion host.
-
Log on to Data Management Service (DMS) 5.0.
-
Move the pointer over the
icon in the upper-left corner and choose . NoteIf you use the DMS console in normal mode, choose in the top navigation bar.
-
Click Install Backup Gateway in the upper-right corner of the page.
-
Select a Network Type of Backup Gateway, copy the proxy gateway installation command, and run it on the bastion host.
Important-
Save this link. You will need this link for Step 2: Install the backup gateway (database host).
-
If you access the source database over a public IP address, select Public. If you access the source database over Alibaba Cloud Express Connect, select ECS Private Network/VPC.
-
In the Linux command-line interface (CLI), run the installation command. The system downloads and automatically runs the installation package. The following example shows the command output:
[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] -
Enter 1 for English.
Select your language 0 [x] chn 1 [ ] eng Input selection: 0 -
Enter 1 to continue.
Press 1 to continue, 2 to quit, 3 to redisplay 1 -
Enter 1 to accept the agreement.
Press 1 to accept, 2 to reject, 3 to redisplay 1 -
Select the component to install. Y installs the backup gateway (Agent) and N installs the proxy gateway (database gateway DG). To install the proxy gateway, enter N and then enter Y to confirm your selection.
Enter Y for Yes, N for No: N -- DG -- Enter Y for Yes, N for No: Y Done! -
Enter 1 to continue the installation.
Press 1 to continue, 2 to quit, 3 to redisplay 1 -
Select an installation path. Press Enter to use the default path
/usr/local/aliyun/dbs_agent.If you want to install the software in a custom path, enter the target path and then enter 1 to confirm. This topic uses the
/usr/local/aliyun/proxy_dbs_agentdirectory as an example.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 -
Confirm the component to install and enter 1 to start the installation.
The installation takes 1 to 5 minutes.
Select the packages that you want to install: [x] Pack 'Proxy Gateway Base Files' 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 Files (1/1) ] Cleaning up the target folder ... [ Unpacking finished ] Installation finished ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Installation complete ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Installation was successful Application installed on /usr/local/aliyun/daili_dbs_agent [ Writing the uninstaller data ... ] [ Console installation done ]
-
-
Run the following command to verify that the proxy gateway is running:
ps aux | grep app_aliyun_proxySimilar output indicates that the proxy gateway is installed and the process is running correctly. If you encounter other errors that you cannot resolve, contact the DBS customer group on DingTalk (group ID: 35585947).
[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 -
After installing the proxy gateway on the bastion host, install the backup gateway on the database host.
2. Install the backup gateway (database host)
Install the DBS backup gateway on your self-hosted database server. During the installation, enter the IP address of the proxy gateway (the private IP address of the bastion host).
-
Copy the gateway download link from Step 4 in the Install the proxy gateway on the bastion host section, and manually download the package to your self-hosted database server.
ImportantThe backup gateway download link must match the link in Step 4 of the Install the proxy gateway section. Otherwise, the database host cannot connect to the external network.
-
Install the DBS backup gateway (AliyunDBSAgent) on your local Windows device or server.
-
In the downloaded folder, double-click setup.exe.
-
Select an installation language, click OK, and then click Next.
-
Read and accept the agreement, and then click Next.
-
Select DBS Backup Gateway, and then click Next.
-
Select an installation path, click Next, and then click OK.
-
Select a Backup Gateway Region, enter your Access Key ID, Access Key Secret, Proxy Gateway Address, and Proxy Gateway Port, and click Next.
Important-
Ensure the installation region for the DBS backup gateway matches the region of the target RDS for SQL Server instance.
-
Your Access Key ID and Access Key Secret are stored in plaintext in the
.\config\dbs-agent.conffile in the installation directory. -
For Proxy Gateway Address, enter the private IP address of the bastion host. The Proxy Gateway Port defaults to 9797.
After completing the configuration, the system attempts to connect to the proxy gateway that you configured on the bastion host in Step 1. If the connection fails, the system reports an error. If this occurs, verify the proxy gateway installation.
-
-
Confirm the component packages and click Next.
The backup gateway installation starts. The process takes 1 to 5 minutes.
-
Click Done.
You can verify the installation status in the
C:\Program Files\aliyun\dbs_agent\logs\agent.logfile. The gateway is successfully installed if the log contains entries similar to the following example. This log shows the gateway sending a heartbeat request every 10 seconds.2021-01-05 00:00:01 INFO KeepAliveActor:100 - start process tick tock request with id 377119 2021-01-05 00:00:01 INFO KeepAliveActor:224 - processed keep alive message with request id 377119 2021-01-05 00:00:11 INFO KeepAliveActor:100 - start process tick tock request with id 377120 2021-01-05 00:00:11 INFO KeepAliveActor:224 - processed keep alive message with request id 377120 2021-01-05 00:00:21 INFO KeepAliveActor:100 - start process tick tock request with id 377121 2021-01-05 00:00:21 INFO KeepAliveActor:224 - processed keep alive message with request id 377121 2021-01-05 00:00:31 INFO KeepAliveActor:100 - start process tick tock request with id 377122 2021-01-05 00:00:31 INFO KeepAliveActor:224 - processed keep alive message with request id 377122 2021-01-05 00:00:41 INFO KeepAliveActor:100 - start process tick tock request with id 377123 2021-01-05 00:00:41 INFO KeepAliveActor:224 - processed keep alive message with request id 377123 2021-01-05 00:00:51 INFO KeepAliveActor:100 - start process tick tock request with id 377124 2021-01-05 00:00:51 INFO KeepAliveActor:224 - processed keep alive message with request id 377124 2021-01-05 00:01:01 INFO KeepAliveActor:100 - start process tick tock request with id 377125 2021-01-05 00:01:01 INFO KeepAliveActor:224 - processed keep alive message with request id 377125 2021-01-05 00:01:11 INFO KeepAliveActor:100 - start process tick tock request with id 377126 2021-01-05 00:01:11 INFO KeepAliveActor:224 - processed keep alive message with request id 377126 2021-01-05 00:01:21 INFO KeepAliveActor:100 - start process tick tock request with id 377127 2021-01-05 00:01:21 INFO KeepAliveActor:224 - processed keep alive message with request id 377127 2021-01-05 00:01:31 INFO KeepAliveActor:100 - start process tick tock request with id 377128 2021-01-05 00:01:31 INFO KeepAliveActor:224 - processed keep alive message with request id 377128 2021-01-05 00:01:41 INFO KeepAliveActor:100 - start process tick tock request with id 377129 2021-01-05 00:01:41 INFO KeepAliveActor:224 - processed keep alive message with request id 377129
-
-
After installing the DBS backup gateway, return to the Installation Command dialog box in the DTS console and click Installed.
-
Verify that the DBS backup gateway is running.
-
In the Windows Run dialog box, enter
services.mscand click OK. -
In Service Manager, check whether the service has started. If not, right-click AliyunDBSAgent and select Start from the shortcut menu.
NoteThe backup gateway starts by default. You can also start or stop the AliyunDBSAgent service in Service Manager.
-
-
View the newly added DBS backup gateway.
On the Backup Gateway page, click Refresh in the upper-right corner to view the new DBS backup gateway.
NoteThe name of the new DBS backup gateway starts with
DTS_.
3. Create a DTS migration task
-
Go to the Data Transmission Service (DTS) console.
-
In the left-side navigation pane, click Data Migration. In the top navigation bar, select a region.
-
Click Create Task and configure the source and target databases.
Category
Parameter
Description
N/A
Task Name
Specify a descriptive name for the task for easy identification. The name does not have to be unique. You can also use the default system-generated name.
Source Database
Select Existing Connection
If you have saved the source database connection information in DTS Data Connection Management, you can select it from the drop-down list to avoid re-entering it.
Database Type
Select SQL Server.
Connection Type
Select Physical Protocol.
Instance Region
The default value is the region where the self-hosted SQL Server database is located.
Physical Protocol Gateway (DBS Backup Gateway)
Select the DBS backup gateway that you installed in 2. Install the backup gateway on the database host.
Domain Name or IP
The default value is localhost.
Port
Enter the service port of the self-hosted SQL Server database. The default port is 1433.
Destination Database
Select Existing Connection
If you have saved the target database connection information in DTS Data Connection Management, you can select it from the drop-down list to avoid re-entering it.
Database Type
The default value is SQL Server.
Connection Type
The default value is Alibaba Cloud Instance.
Instance Region
Select the region where the target ApsaraDB RDS for SQL Server instance is located.
Instance ID
Select the ID of the target ApsaraDB RDS for SQL Server instance.
Database Account
Enter the database account for the target ApsaraDB RDS for SQL Server instance. This account must have read and write permissions.
NoteIn the ApsaraDB RDS console, you can create a standard or privileged account and modify account permissions as needed.
Database Password
Enter the password for the database account.
Connection Method
-
If SSL encryption is not enabled for the target database, select Non-encrypted.
-
If SSL encryption is enabled for the target database, select SSL-encrypted. DTS trusts the server-side certificate by default.
-
-
After you configure the settings, click Test Connectivity and Proceed at the bottom of the page.
ImportantEnsure that you add the DTS server IP addresses from the pop-up to the allowlist of your self-managed SQL Server database. The action to add DTS IP addresses may pose security risks. Please acknowledge these risks and take appropriate protective measures, such as increasing password strength and restricting ports.
-
Configure the migration objects.
Parameter
Description
Task Step
-
If you need to perform only a full migration, select Full Data Migration. This option is selected by default.
-
If you want a near-zero-downtime migration, select both Full Data Migration and Incremental Data Migration.
NoteIf you do not select Incremental Data Migration, do not write new data to the source database during the data migration to ensure data consistency.
Source Objects
In the Source Objects box, click an object that you want to migrate, and then click
to move it to the Selected Objects box.NoteYou can migrate a single database, multiple databases, or an entire instance.
Selected Objects
Displays the objects to be migrated.
-
-
Click Next: Advanced Settings to configure advanced parameters.
Parameter
Description
Monitoring and Alerting
Select whether to set alerts and receive alert notifications based on your business needs.
-
No: Does not set an alert.
-
Yes: Configure alerts by setting an alert threshold and an alert contact. If a migration fails or the latency exceeds the threshold, the system sends an alert notification.
Retry Time for Failed Connections
After the migration task starts, if the connection to the source or destination database fails, DTS reports an error and immediately begins to retry the connection. The default retry duration is 720 minutes. You can customize the retry time to a value from 10 to 1440 minutes. We recommend that you set the duration to more than 30 minutes. If DTS reconnects to the source and destination databases within the specified duration, the migration task automatically resumes. Otherwise, the task fails.
Note-
For multiple DTS instances that share the same source or destination, the network retry time is determined by the setting of the last created task.
-
Because you are charged for the task during the connection retry period, we recommend that you customize the retry time based on your business needs, or release the DTS instance as soon as possible after the source and destination database instances are released.
-
-
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 pre-check before the data migration task begins. The task can start only after this check passes.
-
If the pre-check fails, click View Details for the failed item, fix the issue as described, and then rerun the pre-check.
-
If a warning is reported during the pre-check:
-
For items that cannot be ignored, click View Details for the failed check item. Fix the issue as prompted and then run the pre-check again.
-
For warnings that you can ignore, click Confirm Alert Details, Ignore, OK, and then Precheck Again to skip the warning and run the pre-check again. If you ignore a warning, data inconsistency or other issues may occur and introduce business risks.
-
-
-
When the Success Rate is 100%, click Next: Purchase Instance.
-
On the buy page, read and select the Data Transmission Service (Pay-as-you-go) Service Terms checkbox.
-
Click Buy and Start. In the OK dialog box that appears, click OK.
On the Data Migration page, you can click the target migration instance and view the migration progress on the Task Management page.
NoteYou can also view the full or incremental migration progress on the page for the target instance in the ApsaraDB RDS console.
-
When the full migration progress reaches 100% and the incremental migration task is running, go to the migration task's page and click Migration to Cloud.
-
In the Are you sure you want to switch over to the cloud? dialog box, click Start Now and wait for the migration task to complete.
ImportantTo ensure data consistency, stop writing data to the source database before you start the cutover. Wait for the cutover task to complete, and then switch your application connections to the target instance. The process typically takes several minutes.
Appendix: Differences between cloud migration by using a backup gateway and logical data migration
|
Item |
Backup gateway-based migration |
Logical data migration |
|
Migration principle |
Uses the database's native physical backup protocol to write data blocks to the destination. |
Uses a logical protocol, such as JDBC, to retrieve SQL statements and write them to the destination. |
|
Operating system requirements |
Supports only SQL Server on Windows. The desktop version must be Windows XP or later, and the server version must be Windows Server 2003 or later. |
No restrictions. |
|
Deployment requirements |
Requires installing a physical protocol gateway on the server that hosts the source database. |
No gateway installation is required. |
|
Network connectivity requirements |
The solution depends on whether the server hosting the self-managed database can access the Alibaba Cloud service network: |
Requires opening the database port or using a leased line. |
|
Source database permissions |
Requires the sysadmin server role. |
Requires SELECT permission for schema migration and full migration, and the sysadmin server role for incremental migration. For more information, see Database account permissions. |
|
Destination database version |
The destination database version must be the same as or newer than the source database version. |
Supports migration between different versions, including from a newer to an older version. |
|
Destination database accessibility |
The destination database is inaccessible during the migration. |
The destination database remains accessible for read and write operations during the migration. |
|
Source database table limitations |
Memory tables and the FileStream and FileTable data types are not supported. |
For limitations, see Source database limitations. |
|
Supported migration scenarios |
Migrating self-managed databases to the cloud. Note
Self-managed SQL Server databases on ECS instances, in data centers (IDC), or on third-party cloud servers. |
Migrating self-managed or third-party cloud-hosted databases to the cloud. |
|
Migration efficiency |
High. |
Medium. |
|
Data processing (ETL) |
Not supported. |
Supported. |
|
Table-level filtering |
Not supported. |
Supported. |
|
Database-level filtering |
Supported. |
Supported. |