All Products
Search
Document Center

ApsaraDB RDS:Restore the data of a self-managed MySQL instance to an ApsaraDB RDS for MySQL instance

Last Updated:Oct 17, 2023

This topic describes how to restore the full data of a self-managed MySQL instance to an ApsaraDB RDS for MySQL instance.

Note

Prerequisites

Billing rules

After a user backup file is imported to an ApsaraDB RDS instance, the file is stored free of charge within 24 hours. If the file is stored for more than 24 hours, you are charged storage fees. For more information, see Storage fees.

Import the full backup file into the destination RDS instance

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

  2. On the User Backups tab, click Import Backup.

  3. In the Import Guide wizard, read the messages that are displayed and click Next until you enter the 3. Import Data step.

    Note

    The Import Backup wizard walks you through the migration process.

  4. In the Step 3: Import the data step, configure the following parameters and click OK.

    Parameter

    Description

    MySQL version

    The value 5.7/8.0 is automatically displayed.

    Note

    You can import the data of a self-managed instance that runs MySQL 5.7 or MySQL 8.0.

    Region

    Select the region that you specified in Step 1. You must set this parameter to the region of the OSS bucket that stores the full backup file.

    OSS Bucket

    Select the OSS bucket that stores the full backup file of the self-managed MySQL instance. For more information about OSS buckets, see Upload objects.

    OSS file name

    Select the full backup file that is stored as an object in the OSS bucket. You can enter the name of the full backup file in the OSS file name field to search for the file. Fuzzy match and exact match are supported.

    Note

    Enter a description that helps you identify the full backup file.

    Zone

    Select the zone of the OSS bucket that stores the full backup file. After you select a zone, ApsaraDB RDS creates a snapshot in the zone in single-digit seconds. This greatly reduces the time that is required to import the full backup file into the OSS bucket.

    Note

    After the full backup file is imported, you can restore the data of the full backup file to a new RDS instance. The new RDS instance resides in the zone that you select.

    Storage Capacity

    Specify the amount of storage that is required for the full backup file. Valid values: 20 to 6000: Unit: GB.

    Note

    By default, the amount of storage that is required is 3 times the size of the full backup file. If the file size multiplied by 3 does not exceed 20 GB, this parameter defaults to 20.

    Note
    • If ApsaraDB RDS is not authorized to access OSS, click Authorize in the lower part of the 3. Import Data step. In the lower-left corner of the page that appears, click Confirm Authorization Policy.

    • For more information, read the instructions on this page.

  5. The system creates a task to verify the full backup file on the User Backups tab. Wait until the Status parameter value of the task changes from Verifying to Completed.

    Important

    The period of time that is required to verify the user backup file varies based on the status of the RDS instance when it is backed up. For example, a long period of time is required to verify the user backup file in the following scenarios: A large number of write operations are performed on the RDS instance during the instance backup and therefore a large number of redo logs are generated, or large transactions are executed on the RDS instance during the instance backup.

Restore the data of the full backup file to an RDS instance

After the full backup file is imported into ApsaraDB RDS, you can restore the data of the full backup file to a new RDS instance. For more information, see Import the full backup file into the destination RDS instance.

Important

The full backup file is retained three days by default. After the retention period elapses, ApsaraDB RDS automatically deletes the full backup file. We recommended that you restore the data of the full backup file to a new RDS instance within the retention period. You can adjust the retention period. For more information, see Set the retention period of the full backup file.

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

  2. Find the full backup file in the Backup ID/Name column. Then, click Restore in the Actions column of the full backup file.

  3. Configure the following parameters and click Next: Instance Configuration.

    Parameter

    Description

    Zone of Primary Node

    The zone to which the primary RDS instance belongs.

    Note

    If you did not select a zone for the OSS bucket that stores the full backup file when you import the file, this parameter is displayed. If you selected a zone for the OSS bucket that stores the full backup file when you import the file, this parameter is not displayed.

    Storage type

    • ESSD PL1: an enhanced SSD (ESSD) of performance level 1 (PL1).

    • Standard SSD: A standard SSD is an elastic block storage device that is designed based on the distributed storage architecture of Alibaba Cloud. You can store data on standard SSDs to separate computing from storage.

    Note

    For more information, see Storage types.

    Instance Type

    General-purpose (Entry-level): A general-purpose RDS instance exclusively occupies the allocated memory and I/O resources. However, it shares CPU cores and storage resources with the other general-purpose RDS instances that are deployed on the same host.

    Note

    Each instance type supports a specific number of CPU cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary ApsaraDB RDS instance types.

    Capacity

    The storage capacity that is provisioned to store data files, system files, log files, and transaction files in the RDS instance. You can adjust the storage capacity at a step size of 5 GB.

  4. Configure the following parameters and click Next: Confirm Order.

    Parameter

    Description

    Network Type

    The network type of the RDS instance. Select VPC. A virtual private cloud (VPC) is an isolated network that provides higher security and better performance than the classic network. If you select the VPC network type, you must also configure the VPC and vSwitch of Primary Node parameters.

    Note

    The RDS instance and the Elastic Compute Service (ECS) instance that you want to connect must reside in the same VPC. Otherwise, the RDS instance and the ECS instance cannot communicate over an internal network.

    Parameter Template

    The parameter template that is used by the RDS instance. You can select a system parameter template or a custom parameter template. For more information, see Use a parameter template to configure the parameters of ApsaraDB RDS for MySQL instances.

    Time Zone

    The time zone of the RDS instance.

    Table Name Case Sensitivity

    Specifies whether table names in the RDS instance are case-sensitive. If table names in the self-managed MySQL instance are case-sensitive, we recommend that you select Case-sensitive to facilitate data migration between the RDS instance and the self-managed MySQL instance.

  5. Confirm the configuration of the RDS instance in the Parameters section, configure the Purchase Plan parameter, read and select Terms of Service, and then click Pay Now to complete the payment.

    Note

    ApsaraDB RDS requires 1 to 5 minutes to create the RDS instance. Wait until the instance is created.

Set the retention period of the full backup file

By default, the full backup file is retained for three days after it is imported into ApsaraDB RDS. For more information, see Import the full backup file into the destination RDS instance. You can adjust the retention period based on your business requirements.

Note

If you no longer need a full backup file, you can delete the file. For more information, see Delete the full backup file.

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

  2. Click Set Retention Period in the Expiration Time column to the right of the Backup ID/Name column.

  3. In the dialog box that appears, select a retention period from the drop-down list provided by ApsaraDB RDS. Alternatively, select Custom Retention Period and then enter a retention period. You can click the upward arrow or the downward arrow to adjust the retention period.

    Note

    Expiration Time shows the expiration time of the full backup file. If the expiration time exceeds 2099, it is displayed as Permanent.

  4. Click OK.

Add tags to the full backup file

After the full backup file is imported into ApsaraDB RDS, you can add tags to the file.

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

  2. Click +Add Tag in the Tags column to the right of the Backup ID/Name column.

  3. Click Create Tag, enter the Key and Value of the tag, click OK to the right of the field to create the tag, and then click OK in the lower-right corner of the dialog box to add the tag.

    Note

    If you have created a tag, click Select Tag to add the tag to the full backup file.

  4. If you want to change the tag of the full backup file, move the pointer over the tag and click Edit. In the tooltip that appears, repeat Step 3 to create or select a tag.

Check log data of the full backup file

If data changes are made in the self-managed MySQL instance during the full backup, the generated full backup file contains log information. You can use the log data to restore the incremental data. For more information, see Migrate the data of a self-managed MySQL 5.7 or MySQL 8.0 instance to an ApsaraDB RDS for MySQL instance.

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

  2. Click View Details in the Actions column to the right of the Backup ID/Name column.

  3. In the message that appears, check the log data.

    Note

    The following list describes the log information:

    • Master_Log_File:: the name of the first log file that stores incremental data.

    • Master_Log_Position:: the first log entry that contains incremental data in the first log file.

Delete the full backup file

If you no longer need the full backup file, you can delete the file to reduce costs.

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

  2. Click Delete in the Actions column to the right of the Backup ID/Name column.

  3. In the message that appears, click OK.

Other features

  • Filter Columns: You can click the icon to show or hide columns on the User Backups tab. By default, all columns are displayed.

    1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

    2. In the upper-right corner of the tab, click the 自定义列表项 icon. In the dialog box that appears, select the columns that you want to display or hide, and click the 右 or 左 icon to manage the columns.

      Note

      The columns in the left-side list are hidden, and the columns in the right-side list are displayed.

    3. Click OK.

  • Export Instance List : You can click the icon to export the backup information as a CSV file.

    1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

    2. In the upper-right corner of the tab, click the 导出资源列表 icon to export the backup information.

  • Refresh: You can click the icon to refresh the User Backups tab.

    1. Log on to the ApsaraDB RDS console. In the top navigation bar, select a region. In the left-side navigation pane, click Backups.

    2. Click the 刷新 icon to refresh the User Backups tab.

Related operations

Operation

Description

ImportUserBackupFile

Imports a specific full backup file of a self-managed MySQL database into an ApsaraDB RDS for MySQL instance.

UpdateUserBackupFile

Modifies the description and retention period of auser backup.

ListUserBackupFiles

Queries the details about one or more full backup files that are imported into ApsaraDB RDS for MySQL instances in a region.

DeleteUserBackupFile

Delete a full backup file.