Help Center> Data Replication Service> Getting Started> Backup Migration> Scenario 2: Migrating Data from an OBS Bucket

Scenario 2: Migrating Data from an OBS Bucket

This section describes how to migrate backup data in the OBS buckets. To migrate data from on-premises databases, you can upload the backup data to an OBS bucket and then migrate the backup data from the OBS bucket.

This section describes how to create a backup migration task on the DRS console.

Prerequisites

  • You have logged in to the DRS console.
  • Your account balance is greater than or equal to ¥0.
  • The database types meet the requirements for backup migration. For details, see Backup Migration.
  • The constraints on backup migration are met. For details, see Before You Start.

Procedure

The following procedure uses the Microsoft SQL Server engine as an example to describe how to configure a database backup and migration task. The procedures for configuring other storage engines are similar.

  1. On the Backup Migration Management page, click Create Migration Task.
  2. On the Select Backup page, specify information about the task and backup files. Then, click Next.

    Figure 1 Task information
    Table 1 Task settings

    Parameter

    Description

    Task Name

    The task name consists of 4 to 50 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 !=<>'&"

    Tags

    This setting is optional. Adding tags helps you better identify and manage your tasks. Each task can have up to 10 tags.

    After a task is created, you can view its tag details on the Tags tab. For detailed operations, see Tag Management.

    Figure 2 Backup file information
    Table 2 Backup file information

    Parameter

    Description

    Database Type

    Database type of the backup file. Select Microsoft SQL Server.

    Backup File Source

    Select OBS Bucket.

    Bucket Name

    Select a bucket and a backup file stored in the directory of the bucket.

    NOTE:
    • The backup file of the Microsoft SQL Server must be named in the .bak format in the OBS bucket directory. Multiple backup files can be selected at the same time.
    • The bucket name, backup file name, or path cannot contain Chinese characters.

  3. On the Select Destination page, specify database information and click Next.

    Figure 3 Microsoft SQL Server database information
    Table 3 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 Buy a DB Instance section in the Relational Database Service Getting Started.

    Backup Type

    Select Full or Incremental.

    • Full: indicates full backup files.
    • Incremental: indicates log backup files.
      NOTE:
      • Before performing an incremental restoration, you need to perform a full restoration.
      • To migrate databases at a time, you need to stop services first and upload full backups for restoration.
      • To ensure service continuity during a migration, perform a full backup and multiple incremental backups, and then upload the backup data to OBS for restoration.

    Last Backup File

    Multiple incremental backup files will be used during the restoration. The destination RDS 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.

    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. Exercise caution when performing this operation.

    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 part of databases. All of databases are restored by default.

    • All: Restore all databases from the backup file. You do not need to enter the name of the database to be restored.
    • Custom: Restore part of databases from the backup file. You need to enter the name of the database 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 need to specify Backup Database Name. This function ignores the original database name in the backup file and restores the name of the new database by using the DRS.

    Constraint:

    • The backup file contains only one database.
    • The backup file is a full backup file and restored at a time. 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 Incremental and Restore Database is set to All.

    Backup Database Name

    If Restore Database is set to Custom, you need to specify Backup Database Name.

    The backup database name must be the same as that in the backup file and consist of 1 to 256 characters. It can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).

    DRS also allows you to create an alias for the database to be restored.

    • If you choose to restore databases in full backup mode, you can set the alias of the database based on the site requirements. The alias is also stored in the destination database.
    • If databases are restored in incremental backup mode, alias is not supported.
    NOTE:

    The backup database can be renamed. A maximum of 100 backup databases can be created.

  4. On the Confirm Task page, check configuration details, read and agree to the agreement, and click Next.
  5. 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.