Scenario 2: Full+Incremental Backup Migration
In this scenario, data is migrated continuously. After a full backup and restoration is complete, you can perform incremental migrations for several times to minimize service interruption. A complete restoration process involves restoring several incremental backup files. The destination DB instance will not be available until the last backup file is restored. You can determine whether the selected backup file is the last one.
This section uses a full+incremental migration as an example to describe how to perform a migration while minimizing service interruption.
Migration Diagram
Migration Process
First Full Migration
- Export the full backup file of the database. For details, see Exporting Backup Files.
- Upload files to an OBS bucket. For details, see Uploading Backup Files.
- Log in to the DRS console.
- Click in the upper left corner and select a region and a project.
- Choose Service List > Databases > Data Replication Service.
- In the navigation pane on the left, choose Backup Migration Management. Then, click Create Migration Task.
- Enter the information about the migration task and backup file, and click Next.
Figure 3 Migration task information
Table 1 Migration task information Parameter
Description
Task Name
The task name consists of 4 to 64 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).
Description
The description consists of a maximum of 256 characters and cannot contain the following special characters: !=<>'&"
Database Type
Select Microsoft SQL Server.
Backup File Source
Select OBS bucket.
Bucket Name
Select the bucket where the backup file is stored and the full backup file.
NOTE:- The backup file of the Microsoft SQL Server must be in the .bak format. Multiple backup files can be selected at the same time.
- A database cannot be split into different files for upload.
- The bucket name, backup file name, or path cannot contain Chinese characters.
- If the number of data records in a bucket exceeds 500, data overflow may occur. As a result, some data cannot be displayed. You can use an independent standard bucket with the public-read permission.
- On the Select Destination page, specify database information and click Next.
Figure 4 Full migration database information
Table 2 Microsoft SQL Server database information Parameter
Description
Destination RDS DB Instance Name
Select a destination RDS DB instance. If no RDS DB instance is available, you can buy one by referring to the
Backup Type
Select Full.
Full: indicates full backup files.
Last Backup File
A complete restoration process involves restoring several incremental backup files. The destination DB instance will not be available until the last backup file is restored. You can determine whether the selected backup file is the last one. Select Yes in either of the following scenarios:
- Perform a one-time full migration.
- The selected backup file is the last one to be restored.
Select No in the scenario where you continue to restore databases using incremental backup files after a full backup restoration is performed. In this case, the destination database is in the restoring state and cannot be read or written.
Overwrite Data
You can determine whether to overwrite data in the destination database during the restoration if the destination DB instance contains a database with the same name as the backup database.
NOTE:If you select this option, the destination databases with the same names as the backup databases will be overwritten. Exercise caution when performing this operation.
Perform Pre-verification
Specifies whether to perform pre-verification on the backup migration task. The default value is Yes.
- Yes: To ensure successful migration and identify potential problems in advance, verify the validity, integrity, continuity, and version compatibility of backup files before restoration.
- No: If pre-verification is not performed, the migration speed is faster, but you need to check the validity, integrity, continuity, and version compatibility of backup files on your own.
Restore Database
You can restore all or some of databases.
- All: Restores all databases in the backup file. You do not need to enter the names of the databases to be restored. By default, all databases in the backup file are restored.
- Custom: Restore specified databases from the backup file. You need to enter the names of the databases to be restored.
The databases to be restored must be consistent with those for which the full or incremental backups are created.
Reset Database Name
If Restore Database is set to All, you can reset database names. If you enable Reset Database Name, the original database names in the backup file will be reset to new database names.
Prerequisites:
- The backup file contains only one database.
- The backup file is a full backup file and is the last backup file. Select Full for Backup File and Yes for Last Backup Type.
NOTE:The database name can be reset only when Backup Type is set to Full and Restore Database is set to All.
Backup Database Name
If Restore Database is set to Custom, specify Backup Database Name.
The backup database name is case sensitive and must be the same as that in the backup file. The backup database name can contain a maximum of 256 bytes, and the new database name can contain a maximum of 128 bytes. Only letters, digits, hyphens (-), and underscores (_) are allowed.
DRS also allows you to set an alias for the database to be restored.
- On the Confirm Task page, check the configuration details, read and agree to the agreement, and click Next.
- In the task list on the Backup Migration Management page, check whether the task is in the Restoring status. If the migration is successful, the task status becomes Successful.
First Incremental Migration
- Export the first incremental backup file of the database. For details, see Exporting Backup Files.
- Upload files to an OBS bucket. For details, see Uploading Backup Files.
- Log in to the DRS console.
- In the navigation pane on the left, choose Backup Migration Management. Then, click Create Migration Task.
- Enter the information about the migration task and backup file, and click Next.
Figure 5 Incremental backup
Table 3 Migration task information Parameter
Description
Task Name
The task name consists of 4 to 64 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).
Description
The description consists of a maximum of 256 characters and cannot contain the following special characters: !=<>'&"
Database Type
Select Microsoft SQL Server.
Backup File Source
Select OBS bucket.
Bucket Name
Select the bucket where the backup file is stored and the first incremental backup file.
NOTE:- The backup file of the Microsoft SQL Server must be in the .bak format. Multiple backup files can be selected at the same time.
- A database cannot be split into different files for upload.
- The bucket name, backup file name, or path cannot contain Chinese characters.
- On the Select Destination page, specify database information and click Next.
Figure 6 Incremental migration database information
Table 4 Microsoft SQL Server database information Parameter
Description
Destination RDS DB Instance Name
Select a destination RDS DB instance.
The destination RDS DB instance must be the same as the DB instance selected during full backup and restoration.
Backup Type
Select Incremental.
Incremental: indicates log backup files.
Last Backup File
A complete restoration process involves restoring several incremental backup files. The destination DB instance will not be available until the last backup file is restored. You can determine whether the selected backup file is the last one. Select Yes in either of the following scenarios:
- Perform a one-time full migration.
- The selected backup file is the last one to be restored.
Select No if the incremental backup is performed for the first time. In this case, the destination database is in the restoring state and cannot be read or written.
Perform Pre-verification
Specifies whether to perform pre-verification on the backup migration task. The default value is Yes.
- Yes: To ensure successful migration and identify potential problems in advance, verify the validity, integrity, continuity, and version compatibility of backup files before restoration.
- No: If pre-verification is not performed, the migration speed is faster, but you need to check the validity, integrity, continuity, and version compatibility of backup files on your own.
Restore Database
You can restore all or some of databases.
- All: Restores all databases in the backup file. You do not need to enter the names of the databases to be restored. By default, all databases in the backup file are restored.
- Custom: Restore specified databases from the backup file. You need to enter the names of the databases to be restored.
- On the Confirm Task page, check the configuration details, read and agree to the agreement, and click Next.
- In the task list on the Backup Migration Management page, check whether the task is in the Restoring status. If the migration is successful, the task status becomes Successful.
Second Incremental Migration
To minimize the service interruption caused by migration, you need to back up, upload, and restore transaction logs before service migration. These operations will restore historical data to the destination database, which greatly reduces the time for uploading and restoring the last transaction log backup during the migration.
- Before service migration, export new incremental backup files. For details, see Exporting Backup Files.
- Perform 2 to 4.
- Enter the information about the migration task and backup file, and click Next.
Figure 7 Incremental backup
Table 5 Migration task information Parameter
Description
Task Name
The task name consists of 4 to 64 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).
Description
The description consists of a maximum of 256 characters and cannot contain the following special characters: !<>&'\"
Database Type
Select Microsoft SQL Server.
Backup File Source
Select OBS bucket.
Bucket Name
Select the bucket where the backup file is stored and the new incremental backup file.
NOTE:- The backup file of the Microsoft SQL Server must be in the .bak format. Multiple backup files can be selected at the same time.
- A database cannot be split into different files for upload.
- The bucket name, backup file name, or path cannot contain Chinese characters.
- On the Select Destination page, specify database information and click Next.
Figure 8 Incremental migration database information
Table 6 Microsoft SQL Server database information Parameter
Description
Destination RDS DB Instance Name
Select a destination RDS DB instance. The destination RDS DB instance must be the same as the DB instance selected during full backup and restoration.
Backup Type
Select Incremental.
Incremental: indicates log backup files.
Last Backup File
A complete restoration process involves restoring several incremental backup files. The destination DB instance will not be available until the last backup file is restored. You can determine whether the selected backup file is the last one. Select Yes in either of the following scenarios:
- Perform a one-time full migration.
- The selected backup file is the last one to be restored.
Select No if the incremental backup is performed before migration. In this case, the destination database is in the restoring state and cannot be read or written.
Perform Pre-verification
Specifies whether to perform pre-verification on the backup migration task. The default value is Yes.
- Yes: To ensure successful migration and identify potential problems in advance, verify the validity, integrity, continuity, and version compatibility of backup files before restoration.
- No: If pre-verification is not performed, the migration speed is faster, but you need to check the validity, integrity, continuity, and version compatibility of backup files on your own.
Restore Database
You can restore all or some of databases.
- All: Restores all databases in the backup file. You do not need to enter the names of the databases to be restored. By default, all databases in the backup file are restored.
- Custom: Restore specified databases from the backup file. You need to enter the names of the databases to be restored.
- On the Confirm Task page, check the configuration details, read and agree to the agreement, and click Next.
- In the task list on the Backup Migration Management page, check whether the task is in the Restoring status. If the migration is successful, the task status becomes Successful.
Checking Database Transactions
Before service migration, stop services and ensure that no unfinished transaction exists in the database. Otherwise, data may be lost during migration.
- Run the following statement to check whether the IP addresses of the service system are disconnected:
select * from sys.dm_exec_connections;
- If yes, all service system IP addresses are disconnected and the last incremental backup can be migrated.
- If no, go to 2.
- If an IP address is not disconnected, run the following statement to query the sessions that are not closed:
select * from sys.dm_exec_sessions;
Run the following statement to view the transactions that are being executed:
select * from sys.dm_tran_session_transactions;
If the query result contains unclosed sessions and transactions that are being executed, go to 3.
- The last incremental backup can be migrated only after the transaction is complete, the session is closed, and the service system is disconnected.
Last Incremental Migration
After several incremental migrations, the two databases are almost consistent. During the transaction checks, services are stopped and no data will be generated. Then, you need to perform the last incremental migration to ensure the data consistency.
- Export the new incremental backup file of the database. For details, see Exporting Backup Files.
- Perform 2 to 4.
- Enter the information about the migration task and backup file, and click Next.
Figure 9 Incremental backup
Table 7 Migration task information Parameter
Description
Task Name
The task name consists of 4 to 64 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).
Description
The description consists of a maximum of 256 characters and cannot contain the following special characters: !=<>'&"
Database Type
Select Microsoft SQL Server.
Backup File Source
Select OBS bucket.
Bucket Name
Select the bucket where the backup file is stored and the new incremental backup file.
NOTE:- The backup file of the Microsoft SQL Server must be in the .bak format. Multiple backup files can be selected at the same time.
- A database cannot be split into different files for upload.
- The bucket name, backup file name, or path cannot contain Chinese characters.
- On the Select Destination page, specify database information and click Next.
Figure 10 Incremental migration database information
Table 8 Microsoft SQL Server database information Parameter
Description
Destination RDS DB Instance Name
Select a destination RDS DB instance. The destination RDS DB instance must be the same as the DB instance selected during full backup and restoration.
Backup Type
Select Incremental.
Incremental: indicates log backup files.
Last Backup File
Select Yes because it is the last incremental migration after services are stopped.
Perform Pre-verification
Specifies whether to perform pre-verification on the backup migration task. The default value is Yes.
- Yes: To ensure successful migration and identify potential problems in advance, verify the validity, integrity, continuity, and version compatibility of backup files before restoration.
- No: If pre-verification is not performed, the migration speed is faster, but you need to check the validity, integrity, continuity, and version compatibility of backup files on your own.
Restore Database
You can restore all or some of databases.
- All: Restores all databases in the backup file. You do not need to enter the names of the databases to be restored. By default, all databases in the backup file are restored.
- Custom: Restore specified databases from the backup file. You need to enter the names of the databases to be restored.
- On the Confirm Task page, check the configuration details, read and agree to the agreement, and click Next.
- In the task list on the Backup Migration Management page, check whether the task is in the Restoring status. If the migration is successful, the task status becomes Successful.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.