This topic describes how to migrate full backup data from an SQL Server database to ApsaraDB MyBase by using backup sets.
Prerequisites
- The self-managed SQL Server database runs one of the following versions:
- SQL Server 2017 Enterprise Edition.
- SQL Server 2012 Standard Edition, 2012 Enterprise Edition, 2014 Standard Edition, 2016 Standard Edition, 2016 Enterprise Edition, 2017 Standard Edition, and 2019 Standard Edition.
- SQL Server 2012 Enterprise Edition, Basic Edition, 2012 Web Edition, and 2016 Web Edition.
- The storage capacity of ApsaraDB MyBase is sufficient. If the storage capacity of the destination cluster is insufficient, expand the storage capacity of the cluster before the migration. For more information, see Modify the configuration of an instance.
- An Object Storage Service (OSS) bucket is created. Make sure that the OSS bucket and the SQL Server instance in the ApsaraDB MyBase cluster are deployed in the same region. For more information about how to create an OSS bucket, see Create buckets.
Note
You can migrate only one database at a time. If you want to migrate multiple or all the databases at a time, we recommend that you use the instance-level migration solution. For more information, see Migrate data from a self-managed SQL Server instance to an ApsaraDB RDS for SQL Server instance.
Step 1: Perform a full backup for the on-premises database
Preparations
- Make sure that no data is being written to the on-premises database. The data written during the backup process is not backed up.
- Full backup files can be migrated to ApsaraDB MyBase. Differential backup files or
log backup files cannot be migrated to ApsaraDB MyBase. For more information about
differential backup files, see Differential backup files. When you back up the on-premises database, make sure that the backup file is suffixed
with bak.
Note
- bak: specifies a full backup file.
- diff: specifies a differential backup file.
- trn or log: specifies a log backup file of transactions.
- The names of full backup files cannot contain special characters. For example, do
not use forward
slashes (/), asterisks (*), ampersands (&), dollar signs ($), percent signs (%), and at signs (@)
. Otherwise, the migration fails.
Step 2: Upload the backup file to OSS
- Grant the database service account the permissions to access OSS. For more information, see Create an account and a database for an ApsaraDB RDS instance that runs SQL Server 2012, 2016, 2017 SE, or 2019 SE. After the permissions are granted, the system creates a role named AliyunRDSImportRole on the RAM Roles page.
- Do not modify or delete the AliyunRDSImportRole role. Otherwise, the migration fails because the backup file cannot be downloaded. If you modify or delete the role, you must grant the database service account the permissions to access OSS again.
- Method 1 (recommended): Upload the file by using the ossbrowser tool
- Download, install, and then log on to ossbrowser.
- Create and manage buckets and directories.
- Upload the file to the specified bucket or directory.
Note For more information about how to upload the file to the specified bucket or directory, see Upload backup files by using the ossbrowser tool.
- Method 2: Upload the file in the OSS console
If the backup file is smaller than 5 GB, you can upload the backup file in the OSS console. For more information, see Upload files to OSS.
- Method 3: Upload the file by calling OSS API operations
You can implement multipart upload and resumable upload for the backup file by calling OSS API operations. For more information, see Upload backup files by calling OSS API operations.
Step 3: Migrate the backup file to the destination database
What to do next
- Click Refresh to view the latest status of the data migration task.
- On the Backup and Restoration page, click the Backup Data Upload History tab to view the details about the migration task. By default, the details page displays the records of the previous week.