You can migrate data from on-premises or user-created ECS-hosted SQL Server databases to the cloud by using the migration task feature of Database Backup (DBS). The migration task feature enables you to migrate backup data from SQL Server to the cloud in a quick and stable manner.
- A backup gateway is installed on the server that hosts the source instance. For more information, see Add a backup gateway.
- Object Storage Service (OSS) is activated. For more information, see Activate OSS.
- The version of the source SQL Server database is 2005, 2008, 2008 R2, 2012, 2014,
2016, or 2017.
You can use DBS to migrate data from the source instance to an existing ApsaraDB RDS for SQL Server instance. You can also set the Target database instance type parameter to New when you configure a migration task. The system creates an ApsaraDB RDS for SQL Server instance compatible with the source SQL Server database.
The following table describes versions of destination ApsaraDB RDS for SQL Server instances that are compatible with each version of source SQL Server databases.
Source SQL Server database version Destination ApsaraDB RDS for SQL Server SQL Server 2005 to 2012 ApsaraDB RDS for SQL Server 2012 Enterprise Edition SQL Server 2014 to 2016 ApsaraDB RDS for SQL Server 2016 Enterprise Edition SQL Server 2017 ApsaraDB RDS for SQL Server 2017 Enterprise Edition
- Faster migration: In the conventional method, MySQL Connector/J is used to query and upload all data in the source SQL Server database to an ApsaraDB RDS for SQL Server instance. This way, the migration speed is limited by the query performance of MySQL Connector/J. DBS creates a physical backup of the source SQL Server database and copies the physical backup data to the ApsaraDB RDS for SQL Server instance. This is faster than the conventional method.
- Higher success rate for incremental migration: In the conventional method, incremental migration is performed by using redo logs. Errors are prone to occur in the parsing of redo logs, because the redo logs are in the closed-source format. DBS migrates data to the cloud by using native SQL Server interfaces to perform incremental backup and restoration. This provides a higher success rate.
- Ease of use: DBS consolidates information of the source database, backup destination, and destination ApsaraDB for RDS instance to the Configure a backup schedule step and provides user-friendly interfaces. You need only to configure the parameters in this step.
- After you migrate an SQL Server database to an ApsaraDB RDS for SQL Server instance, you cannot modify the name of the destination database in the ApsaraDB RDS for SQL Server instance.
- Only pay-as-you-go backup schedules can be created.
- A backup fee is charged by DBS. You can create only pay-as-you-go backup schedules. For more information, see Backup fees.
- A storage fee is charged by OSS. When you use DBS to migrate databases to Alibaba Cloud, you must use OSS to store backup data. For more information, see OSS pricing.
- A fee is charged by ApsaraDB RDS for SQL Server. The fee is calculated based on the
specifications and storage size of the ApsaraDB RDS for SQL Server instance that is
created. For more information, see ApsaraDB RDS for SQL Server pricing.
Note ApsaraDB RDS for SQL Server instances that are created by DBS are billed on a pay-as-you-go basis.
Create a migration task
- Log on to the DBS console.
- In the left-side navigation pane, choose .
- In the upper-right corner of the Backup data recovery on cloud list page, click Create migration task.
- In the Create migration task dialog box, set the parameters as described in the following
table and click Buy and Start.
Parameter Description Connection Region The region where the backup schedule that you want to purchase resides.Note The backup schedule and the OSS bucket that you want to use must be in the same region. Backup Mode The backup method. Default value: Physical Backup. Database Type The type of the database. Default value: SQLServer. Billing Method The billing method. Default value: Pay-As-You-Go.Note Subscription is not supported.
Configure a backup schedule
- Log on to the DBS console.
- In the left-side navigation pane, choose .
- On the Backup data recovery on cloud list page, click Configure Backup Schedule in the Actions column corresponding to the created migration task.
- In the Configure Backup Source and Destination step of the Configure a Backup Schedule wizard, set the parameters as described in
the following table and click Next.
Section Parameter Description Backup Source Information Backup Mode The backup method. Default value: Physical Backup. Instance Region The region where the source instance resides. Backup Gateway The backup gateway that you want to install. For more information, see Add a backup gateway. Database Type The type of the source database. Default value: SQL Server. Address The endpoint of the source database. Default value: localhost. Port Number The port used to connect to the source database. Default value: 1433. Backup Destination Information Backup Storage Type The type of storage is used to back up data. Select OSS for user. OSS Bucket Name The name of the OSS bucket that you use to store data. Storage Encryption The method that is used to encrypt the stored data. Valid values:
- KMS Encrypted
Configure Destination Database Target database instance type The type of the destination instance. Valid values: New(Recommend) and Use Exists. In this example, select New(Recommend).Note If you select Use Exists, you must set the Database Location, Instance Region, and RDS Instance ID parameters. Database Location The location of the destination database. Default value: RDS Instance. Instance Region The region where you want to create the instance. You can set this parameter based on your location to enable real-time database query. VPC The VPC where the destination database resides. DB InstanceClass The specifications of the instance to be created. The following specifications are available: 4 cores and 16 GB memory, 8 cores and 32 GB memory, 16 cores and 64 GB memory, and 32 cores and 128 GB memory. The default specifications are 4 cores and 16 GB memory. For more information about specifications and prices, see Pricing. Storage Space The storage space of the instance to be created. The default storage space is 500 GB. You can set this parameter to suit your actual business needs. RDS Instance ID The ID of the destination ApsaraDB for RDS instance.Note This parameter is available only when you set Target database instance type to Use Exists.
- In the Edit Backup Objects step, find the database or table that you want to back up in the Available section.
Click the right arrow to add the selected database or table to the Selected section. Then, click Next.Note If you back up an entire database, the permission data and stored procedures are also backed up.
- In the Configure Backup Time step, set the parameters as described in the following table and click Next.
Parameter Description Full-scale Backup Frequency The frequency of the backup schedule. Default value: Single Backup. Real-Time Transaction Log Backup Specifies whether to enable incremental backup. By default, incremental backup is enabled. Transaction Log backup interval The interval at which incremental backup is performed. Full backup does not mark incremental checkpoint Specifies whether to mark out incremental changes for a full data backup. Does not automatically delete backed up incremental Specifies whether to automatically delete historical incremental backups. Enable compression Specifies whether to enable compression. By default, compression is disabled.
- In the Edit Lifecycle step, configure the lifecycle for a full data backup in the Configure Full Data Backup
Lifecycle section.Note If you select Enable for the Real-Time Transaction Log Backup parameter, you must configure the backup time for incremental backup data.
- After the configuration is complete, click Precheck in the lower-right corner of the page.
- If the Precheck Passed message appears, click Start Task.
Start the migration task
- On the Backup data recovery on cloud list page, find the migration task that you configured and click Start in the Actions column. Then, DBS starts to create an ApsaraDB RDS for SQL Server instance and perform a full data backup.
- After the full data backup is complete, DBS starts continuous incremental migration.
The point in time at which the latest incremental backup is complete also appears
in the Migration process column.
Note After the incremental migration starts, the ApsaraDB RDS for SQL Server instance enters the
restoringstate. Data cannot be read from or written to instances in this state. Data in the instance is updated every time an incremental backup is complete.
- After all your business data is migrated to the ApsaraDB RDS for SQL Server instance,
forbid data writes to the source database and mark the current point in time as T0.
After the point in time in the Migration process column reaches T0, click Complete Migration in the Actions column and wait until the status of the migration task becomes Completed.
Note After you click Complete Migration, the ApsaraDB RDS for SQL Server instance enters the
onlinestate. Data can be read from or written to the instance in this state.