This document describes how to migrate data from SQL Server databases in other cloud vendors and self-built SQL Server databases to TencentDB for SQL Server in the TencentDB for SQL Server console.
Overview
Cold backup migration restores data from BAK, TAR, or ZIP files. It is applicable to data migration from SQL Server databases in other cloud vendors and self-built SQL Server databases to TencentDB for SQL Server, and backup can be performed when the system is shut down.
TencentDB for SQL Server supports migrating data to TencentDB for SQL Server via Cloud Object Storage (COS) files or locally uploaded files. Note:
To restore backups with ZIP and TAR files, you need to ensure that the decompressed files are in the same path folder as the ZIP and TAR files before decompression. If they are in the path folder of the next layer, they cannot be parsed.
Note
Before migration, make sure that the version of the target SQL Server instance is not earlier than that of the source instance.
The name of the migrated database cannot be the same as that of the TencentDB for SQL Server instance.
If the backup file is of considerable size, it is recommended to employ the method of "Download File from COS", which entails initially uploading the file to COS and then using a COS link for restoration. For instructions on uploading backup files to COS and obtaining a COS link, please refer to Uploading Backup to COS. Full backups + logs restoration: The target instance and source instance don’t have to be on the same version, as long as the instance version is high.
Full backups + differential backups restoration: The target instance and the source instance must be on the same version.
You need to pay attention to the case sensitivity of the .bak, .tar, and .zip file extensions. Only lowercase letters are supported, and uppercase letters are not supported.
Directions
2. On the instance management page, select the Backup and Restoration tab and click Create.
3. On the backup restoration creation tab, complete Backup Restoration Settings, and click Create Task.
|
Task Name | The task name can contain up to 60 letters, digits, or underscores. |
Backup Upload Method | Local upload and download from COS. |
Restoration Mode | Full backups, full backups + logs, full backups + differential backups. |
Note:
To cancel the creation of backup restoration task, click Cancel, and the task record will not be retained in the backup restoration task list.
4. On the backup restoration creation tab, upload the backup file, and click Save.
Backup upload method falls into the following two types based on step 3.
Note:
If the backup file is of considerable size, it is recommended to employ the method of "Download File from COS", which entails initially uploading the file to COS and then using a COS link for restoration. For instructions on uploading backup files to COS and obtaining a COS link, please refer to Uploading Backup to COS. Upload backup file directly
|
| When you select full backups + logs or full backups + differential backups, there will be requirements for file names. You can click Get Backup Command to generate the corresponding backup command to generate the backup files that conforms to the file naming conventions. Full backups restoration: You cannot use the full backup name of "full backup + differential backup" or "full backup + log files". Full backups + differential backups restoration: Requirements for full backup file name: dbname_localtime_1full1_1noreconvery1.bak Requirements for incremental backup file name: dbname_localtime_1diff1_1noreconvery1.bak Requirements for the name of the last incremental backup file: dbname_localtime_1diff1_1reconvery1.bak Full backups + logs restoration Requirements for full backup file name: dbname_localtime_2full2_2noreconvery2.bak Requirements for log name: dbname_localtime_2log2_2noreconvery2.bak Requirements for the name of the last log: dbname_localtime_2log2_2reconvery2.bak |
| Click Upload to import the backup file locally |
| It is optional. Once enabled, the original database name in the backup file will be reset and then designated as the new database name after it is restored to the cloud database, and you need to enter these two names. Note: Up to 5 databases can be renamed. If a database in the original database was not renamed, its name will remain unchanged after the backup restoration task is completed. |
Download Settings | Support Auto-restoration upon upload completion and *Start restoration manually.
Auto-restoration upon upload completion: The restoration task will be started immediately after you click Save.
Start restoration manually: Click Save, manually start the task on Backup and Restoration** page, and the uploaded backup files are only saved for 24 hours. |
Note:
On the backup file upload page, you can click Previous to review and edit the backup restoration settings.
If no more operation is needed, return to backup restoration settings page and click Next to upload the backup file. To cancel the task, click Cancel.
After returning to the backup restoration settings page, you can click Edit to edit the task name, backup upload method, and restoration mode. After you click Edit, the content of the backup file upload page in step 2 will be cleared, but you can click Create Task to enter the next step for resetting.
|
| When you select full backups + logs or full backups + differential backups, there will be requirements for file names. You can click Get Backup Command to generate the corresponding backup command to generate the backup files that conforms to the file naming conventions. Full backups restoration: You cannot use the full backup name of "full backup + differential backup" or "full backup + log files". Full backups + differential backups restoration: Requirements for full backup file name: dbname_localtime_1full1_1noreconvery1.bak Requirements for incremental backup file name: dbname_localtime_1diff1_1noreconvery1.bak Requirements for the name of the last incremental backup file: dbname_localtime_1diff1_1reconvery1.bak Full backups + logs restoration Requirements for full backup file name: dbname_localtime_2full2_2noreconvery2.bak Requirements for log name: dbname_localtime_2log2_2noreconvery2.bak Requirements for the name of the last log: dbname_localtime_2log2_2reconvery2.bak |
| Paste the source COS backup file link Note: When downloading files from COS, you need to pay attention to the permissions of the original COS file link. The following two permissions are supported: Public read permission: Copy the download address. You need to pay attention to the case sensitivity of the .bak, .tar, and .zip file extensions. Only lowercase letters are supported, and uppercase letters are not supported. |
| It is optional. Once enabled, the original database name in the backup file will be reset and then designated as the new database name after it is restored to the cloud database, and you need to enter these two names. Note: Up to 5 databases can be renamed. If a database in the original database was not renamed, its name will remain unchanged after the backup restoration task is completed. |
Note:
On the backup file upload page, you can click Previous to review and edit the backup restoration settings.
If no more operation is needed, return to backup restoration settings page and click Next to upload the backup file. To cancel the task, click Cancel.
After returning to the backup restoration settings page, you can click Edit to edit the task name, backup upload method, and restoration mode. After you click Edit, the content of the backup file upload page in step 2 will be cleared, but you can click Create Task to enter the next step for resetting.
5. View backup restoration task in the task list
Full backups restoration: The restoration task will automatically end after it is completed.
Full backups + differential backups and full backups + logs: After full backup restoration is completed, you can also execute a subtask of uploading differential backups/logs. When the last file is uploaded successfully, the entire backup restoration task will automatically end.
Practical Tutorial
TencentDB for SQL Server supports cross-account backup restoration, that is, you can get the backup file download URL of an instance under account A, and then restore data under account B. The following describes how to do this.
Note:
After getting the backup file download URL of an instance under account A, perform backup restoration under account B. The two accounts need to be in the same region.
This backup restoration mode currently supports backup files in .bak, .tar, and .zip formats.
You need to pay attention to the case sensitivity of the .bak, .tar, and .zip file extensions. Only lowercase letters are supported, and uppercase letters are not supported.
To use intra-region cross-account backup restoration, the form of the backup file obtained in the console must be unarchived file.
Currently, the backup file download URL needs to be decoded as detailed [below]. Directions
2. On the instance management page, select the Backup Management tab and click View Details in the Operation column of the target unarchived file in the data backup list.
3. Click Download in the pop-up window and copy the download URL.
4. Click here to decode the copied URL on the page redirected to. Note:
Only the first part of the download URL needs to be decoded.
Example: Suppose a download URL is:
https://sqlserver-bucket-bj-1258415541.cos.ap-beijing.myqcloud.com/1312368346%2fsqlserver%2fmssql-8e5hjaiq%2fbackup%2fautoed_instance_58013012_AdventureWorksDW2012_2022_12_29023915.bak?**********
You only need to select the URL part that ends with .bak?
for decoding. Then, combine the output string with the other part of the URL to get the final URL for cross-account backup restoration.
For the above sample URL, take the following part for decoding:
https://sqlserver-bucket-bj-1258415541.cos.ap-beijing.myqcloud.com/1312368346%2fsqlserver%2fmssql-8e5hjaiq%2fbackup%2fautoed_instance_58013012_AdventureWorksDW2012_2022_12_29023915.bak?
It is decoded to:
https://sqlserver-bucket-bj-1258415541.cos.ap-beijing.myqcloud.com/1312368346/sqlserver/mssql-8e5hjaiq/backup/autoed_instance_58013012_AdventureWorksDW2012_2022_12_29023915.bak?
Then, the final URL for cross-account backup restoration is as follows:
https://sqlserver-bucket-bj-1258415541.cos.ap-beijing.myqcloud.com/1312368346/sqlserver/mssql-8e5hjaiq/backup/autoed_instance_58013012_AdventureWorksDW2012_2022_12_29023915.bak?**********
5. Copy the URL for cross-account backup restoration, log in to the TencentDB for SQL Server console with account B, and click an instance ID in the instance list to enter the instance management page. 6. On the instance management page, select the Backup and Restoration and click Create.
7. In the pop-up window, configure the following items and click Create Task.
|
Task Name | Enter the task name, which can contain up to 60 letters, digits, or underscores. |
Backup Upload Method | Select Download File from COS. |
Restoration Mode | Select Full Backup File. |
8. In the Upload Backup File window, paste the URL and click Save.
9. Go to the Backup and Restoration tab, find the backup task you just created, and click Start in the Operation column.
10. In the backup and restoration task list, check the migration task status. When it becomes Migration succeeded, the cross-account backup restoration is completed.
Was this page helpful?