This procedure migrates a self-managed MySQL 5.7 or MySQL 8.0 instance to ApsaraDB RDS by importing its full backup file through the console and restoring it to a new RDS instance.
If data changes occur in the source instance during the backup, the backup file captures log data that you can use to sync incremental changes to the RDS instance. For more information, see Overview of data restoration methods.
Prerequisites
Before you begin, ensure that you have:
A self-managed MySQL 5.7 or MySQL 8.0 instance that meets the migration requirements. See Limits for supported configurations
A full backup of the self-managed instance uploaded to an OSS bucket. The backup file must be in
_QP.XBformat, or packaged asTAR.GZ. See Perform a full backup and upload to OSS for instructions
Step 1: Import the backup file
Log in to the ApsaraDB RDS console. In the top navigation bar, select the target region. In the left-side navigation pane, click Backups.
On the User Backups tab, click Import Backup.
In the Import Guide wizard, follow the on-screen instructions through steps 1 and 2, then proceed to Step 3: Import the data.
Steps 1 and 2 in the wizard cover backing up the source database and uploading the backup to OSS. If you have already completed these steps, click Next to skip them.
On the Step 3: Import the data page, configure the following parameters, then click OK.
If ApsaraDB RDS is not authorized to access OSS, click Authorize at the bottom of the page. On the authorization page, click Confirm Authorization Policy in the lower-left corner.
Parameter Description MySQL version Automatically set to 5.7/8.0. Read-only. Region The region of the OSS bucket that stores the backup file. Must match the region you selected in step 1. OSS Bucket The OSS bucket that contains the backup file. OSS file name The name of the backup file object in the OSS bucket. Fuzzy and exact match are supported. The file must be in _QP.XBformat or packaged asTAR.GZ.Note An optional description to identify this backup. Zone The zone of the OSS bucket. RDS creates a snapshot in this zone in single-digit seconds, which speeds up the import. The new RDS instance is created in this zone. Storage Capacity The storage allocated for the backup. Valid range: 20–6,000 GB. Defaults to 3x the backup file size, with a minimum of 20 GB. Wait for the verification task to complete. On the User Backups tab, monitor the Status column until it changes from Verifying to Completed.
ImportantVerification time varies based on instance activity during the backup. Expect longer verification times if the source instance had heavy write activity (generating large redo logs) or large active transactions during the backup window.
Step 2: Restore the backup to a new RDS instance
Full backup files are retained for 3 days by default. Restore the backup within the retention period. To extend the retention period, see Adjust the retention period below.
Log in to the ApsaraDB RDS console. In the top navigation bar, select the target region. In the left-side navigation pane, click Backups.
On the User Backups tab, find the backup and click Restore in the Actions column.
Configure the basic instance settings, then click Next: Instance Configuration.
Parameter Description Zone of Primary Node The zone for the primary RDS instance. This parameter appears only if you did not select a zone when importing the backup. Storage Type Select a storage type: ESSD PL1 (Enterprise SSD, performance level 1) or Standard SSD (elastic block storage that separates compute from storage). See Storage types for a comparison. Instance Type Select the instance type. General-purpose (Entry-level) instances have dedicated memory and I/O resources, with CPU and storage shared across instances on the same host. Each instance type defines CPU cores, memory, maximum connections, and maximum IOPS. See Primary ApsaraDB RDS instance types. Storage Capacity Storage for the RDS instance, covering data files, system files, log files, and transaction files. Adjust in 5 GB increments. Configure the network and instance parameters, then click Next: Confirm Order.
Parameter Description Network Type Select VPC. A virtual private cloud (VPC) provides better security and performance than the classic network. Also configure the VPC and vSwitch of Primary Node parameters. The RDS instance and any ECS instance you connect must be in the same VPC. Parameter Template Select a system or custom parameter template. See Use a parameter template. Time Zone The time zone for the RDS instance. Table Name Case Sensitivity Whether table names are case-sensitive. Select Case-sensitive if the self-managed instance uses case-sensitive table names, to avoid data migration issues. Review the configuration in the Parameters section, select a Purchase Plan, accept the Terms of Service, and click Pay Now.
RDS takes 1–5 minutes to create the instance.
Manage backup files
After the migration, manage the imported backup file from the ApsaraDB RDS console — navigate to the target region and click Backups in the left-side navigation pane.
Adjust the retention period
By default, imported full backup files are deleted after 3 days. Adjust the retention period if you need more time or want to keep the file permanently.
On the User Backups tab, find the backup and click Set Retention Period in the Expiration Time column.
Select a preset retention period from the drop-down list, or select Custom Retention Period and enter a value.
If the expiration time exceeds 2099, it displays as Permanent.
Click OK.
Add or update tags
On the User Backups tab, find the backup and click +Add in the Tags column.
In the dialog, click Create a label, fill in the Key and Value fields, and click OK next to the fields to create the tag. Click OK in the lower-right corner.
To use an existing tag, select it from the Select the label drop-down list instead.
To update a tag, hover over it and click edit, then repeat step 2.
Check binary log data
If data changed in the source instance during the backup, the backup file contains binary log entries recording those changes. Use these entries to sync incremental data to the RDS instance.
On the User Backups tab, find the backup and click View Details in the Actions column.
In the dialog, note the following log fields: For instructions on applying incremental data, see Step 3: Back up the self-managed MySQL instance and migrate the backup data to the RDS instance.
Field Description Master_Log_FileThe name of the first binary log file containing incremental data. Master_Log_PositionThe position of the first incremental data entry in that log file.
Delete the backup file
Delete the file when you no longer need it to free up storage.
On the User Backups tab, find the backup and click Delete in the Actions column.
Click OK to confirm.
Other operations
On the User Backups tab, use the icons in the upper-right corner for additional operations:
Filter columns — Show or hide columns. Click
to open the column selector. Move columns between the hidden (left) and visible (right) lists using the
and
icons, then click OK.Export backup list — Click
to export the backup list as a CSV file.Refresh — Click
to reload the tab.
What to do next
After the RDS instance is running, complete the migration by syncing any incremental data from the source instance:
Sync incremental data using binary log replication — Apply changes made to the source instance after the backup.
Overview of data restoration methods — Explore other approaches to restore or migrate data.