Updated on 2024-12-12 GMT+08:00

Backup Import from Another Cloud

This section describes how to migrate Redis from another cloud to DCS by importing backup files.

Simply download the source Redis data and then upload the data to an OBS bucket in the same account and region as the target DCS Redis instance. After you have created a migration task on the DCS console, DCS will read data from the OBS bucket and data will be migrated to the target instance.

Prerequisites

  • Before migrating data, read through Migration Tools and Schemes to learn about the DCS data migration function and select an appropriate target instance.
  • By default, a Proxy Cluster instance has only one database (DB0). Before you migrate data from a multi-DB single-node or master/standby instance to a Proxy Cluster instance, check whether any data exists on databases other than DB0. If yes, enable multi-DB for the Proxy Cluster instance by referring to Enabling Multi-DB.
  • By default, a Redis Cluster instance has only one DB (DB0). Before you migrate data from a multi-DB single-node or master/standby instance to a Redis Cluster instance, check whether any data exists on databases other than DB0. To ensure that the migration succeeds, move all data to DB0 by referring to Online Migration with Rump.
  • Prepare the source Redis backup file. The backup file must be in .aof, .rdb, .zip, or .tar.gz format.
  • If a target DCS Redis instance is not available, create one first. For details, see Buying a DCS Redis Instance.
  • If you already have a DCS Redis instance, you do not need to create one again. For comparing migration data and reserving sufficient memory, you are advised to clear the instance data before the migration. For details, see Clearing DCS Instance Data. If any data exists on the target instance, duplicate data between the source and target is overwritten. If the data exists only on the target instance, the data will be retained.

Creating an OBS Bucket and Uploading Backup Files

If the source Redis backup file to be uploaded is smaller than 5 GB, perform the following steps to create an OBS bucket and upload the file on the OBS console. If the backup file to be uploaded is larger than 5 GB, upload the file by referring to instructions.

  1. Create an OBS bucket on the OBS console.

    When creating an OBS bucket, pay attention to the configuration of the following parameters. For details on how to set other parameters, see Creating a Bucket in OBS User Guide.

    1. Region:

      The OBS bucket must be in the same region as the target DCS Redis instance.

    2. Storage Class: Available options are Standard, Infrequent Access, and Archive.

      Do not select Archive. Otherwise, the migration will fail.

  2. In the bucket list, click the bucket created in 1.
  3. In the navigation pane, choose Objects.
  4. On the Objects tab page, click Upload Object.
  5. Specify Storage Class.

    Do not select Archive. Otherwise, the migration will fail.

  6. Upload the objects.

    Drag files or folders to the Upload Object area or click add file.

    A maximum of 100 files can be uploaded at a time. The total size cannot exceed 5 GB.

  7. (Optional) Select KMS encryption to encrypt the uploaded files.
  8. Click Upload.

Creating a Migration Task

  1. Go to the DCS console.
  2. In the navigation pane, choose Data Migration.
  3. Click Create Backup Import Task.
  4. Enter the task name and description.

    The task name must start with a letter, contain 4 to 64 characters, and contain only letters, digits, hyphens (-), and underscores (_).

  5. In the Source Redis area, select OBS Bucket for Data Source and then select the OBS bucket to which you have uploaded backup files.
  6. Click Add Backup and select the backup files to be migrated.

    Figure 1 Specifying the backup file information

  7. In the Target Redis area, select the Target Redis Instance prepared in Prerequisites.
  8. If the target Redis instance has a password, enter the password and click Test Connection to check whether the password is correct. If the instance is not password-protected, click Test Connection directly.
  9. For Target DB, you can specify a DB in the target Redis to migrate data to. For example, if you enter 5, data will be migrated to DB5 of the target Redis. If you do not specify a DB, data will be migrated to a DB corresponding to the source DB.

    • If the source Redis is multi-DB and the target is single-DB (DB0), either ensure that all source data is in DB0, or specify a source DB and set the target DB to 0. Otherwise, migration will fail.
    • For details about DB in DCS for Redis, see Does DCS for Redis Support Multi-DB?

  10. Click Next.
  11. Confirm the migration task details and click Submit.

    Go back to the data migration task list. After the migration is successful, the task status changes to Successful.