Help Center> Distributed Cache Service> User Guide> Migrating Instance Data> Importing Backup Files from an OBS Bucket
Updated on 2024-06-20 GMT+08:00

Importing Backup Files from an OBS Bucket

Scenario

Use the DCS console to migrate Redis data from Redis of another cloud or self-hosted Redis to HUAWEI CLOUD DCS for Redis.

Simply download the source Redis data and then upload the data to an OBS bucket in the same 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.

.aof, .rdb, .zip, and .tar.gz files can be uploaded to OBS buckets. You can directly upload .aof and .rdb files or compress them into .zip or .tar.gz files before uploading.

Prerequisites

  • The OBS bucket must be in the same region as the target DCS Redis instance.
  • The data files to be uploaded must be in the .aof, .rdb, .zip, or .tar.gz format.
  • To migrate data from a single-node or master/standby Redis instance of another cloud, create a backup task and download the backup file.
  • To migrate data from a cluster Redis instance of another cloud, download all backup files, upload all of them to the OBS bucket, and select all of them for the migration. Each backup file contains data for a shard of the instance.

Step 1: Prepare the Target DCS Redis Instance

  • 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, but you need to clear the instance data before the migration. For details, see Clearing DCS Instance Data.

    If the instance data is not cleared before the migration and the source and target instances contain the same key, the key in the target instance will be overwritten by the key in the source instance after the migration.

  • Redis is backward compatible. The target instance version must be the same as or later than the source instance version.

Step 2: Create an OBS Bucket and Upload Backup Files

  1. Upload the backup data files to the OBS bucket by using OBS Browser+.

    If the backup file to be uploaded is smaller than 5 GB, go to step 2 to upload the file using the OBS console.

    If the backup file to be uploaded is larger than 5 GB, follow the instructions provided by OBS.

  2. On the OBS console, upload the backup data files to the OBS bucket.

    Perform the following steps if the backup files are smaller than 5 GB:
    1. Create an OBS bucket.

      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. Default Storage Class: Select Standard or Infrequent Access.

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

    2. In the bucket list, click the bucket created in 2.a.
    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. Specify Server-Side Encryption
    8. Click Upload.

Step 3: Create a Migration Task

  1. Log in 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.
  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.
  7. In the Target Redis area, select the Target Redis Instance prepared in Step 1: Prepare the Target DCS Redis Instance.
  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. Click Next.
  10. 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.