Updated on 2022-02-21 GMT+08:00

Importing Backup Files from an OBS Bucket

Scenario

Use the DCS console to migrate Redis data from Redis of other vendors or self-hosted Redis to 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, .rbb, .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 other cloud vendors, create a backup task and download the backup file.
  • To migrate data from a cluster Redis instance of other cloud vendors, download all backup files and upload all of them to the OBS bucket. Each backup file contains data for a shard of the instance.
  • .rdb backup files of self-hosted Redis 5.0 cannot be imported. .rdb backup files of self-hosted Redis 3.0 or 4.0 can be exported using redis-cli. .rdb files of other cloud Redis can be exported only by creating backup tasks, and cannot be exported by running commands in redis-cli.
  • Redis Cluster instances only support .rdb files and do not support .aof files.

Step 1: Prepare the Target DCS Redis Instance

  • If a DCS Redis instance is not available, create one first. For details, see Creating a DCS Redis Instance.
  • If a DCS Redis instance is available, you do not need to create a new one. However, you must clear the instance data before the migration. For details, see Clearing DCS Instance Data.

You can use a DCS Redis 3.0, 4.0, or 5.0 instance as the target instance.

Step 2: Create an OBS Bucket and Upload Backup Files

  1. Create an OBS bucket.

    1. Log in to the OBS Console and click Create Bucket.
    2. Select a region.

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

    3. Specify Bucket Name.

      The bucket name must meet the naming rules specified on the console.

    4. Set Storage Class to Standard or Infrequent Access.

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

    5. Set Bucket Policy to Private, Public Read, or Public Read and Write.
    6. Specify Multiple AZ Mode and Tags as instructed.
    7. Click Create Now.

  2. Upload the backup data files to the OBS bucket.

    If the backup file to be uploaded is smaller than 50 MB, go to step 3 to upload the file using the OBS console.

    If the backup file to be uploaded is larger than 50 MB, perform the following steps to upload the file using OBS Browser.

    1. Configure user permissions.

      For details, see the OBS Console Operation Guide > Getting Started > Configuring User Permissions.

    2. Download OBS Browser.

      For details, see the OBS Browser Operation Guide > Getting Started > Downloading OBS Browser.

    3. Create access keys (AK and SK).

      For details, see the OBS Browser Operation Guide > Getting Started > Creating Access Keys (AK and SK).

    4. Log in to OBS Browser.

      For details, see the OBS Browser Operation Guide > Getting Started > Logging In to OBS Browser.

    5. Add a bucket.

      For details, see the OBS Browser Operation Guide > Getting Started > Adding a Bucket.

    6. Upload backup data.

      For details, see the OBS Browser Operation Guide > Getting Started > Uploading a File or Folder.

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

    The following steps are applicable if the backup files are smaller than 50 MB.
    1. In the bucket list, click the name of the created bucket.
    2. In the navigation pane, choose Objects.
    3. On the Objects tab page, click Upload Object.
    4. If Upload Mode is set to Batch, a maximum of 100 files can be uploaded at a time. The total size cannot exceed 5 GB.

      To upload objects, drag files or folders to the Upload Object area or click add file.

    5. If Upload Mode is set to Single, upload a single file at a time. The maximum size of the file is 50 MB.

      Click to open the local file browser, select the file to be uploaded, and click Open.

    6. Specify Storage Class.

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

    7. (Optional) Select KMS encryption to encrypt the file you want to upload.

      KMS encryption is not supported when a local backup file is uploaded to an OBS bucket.

    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. Specify Task Name and Description.
  5. Select OBS Bucket for Data Source and then select the OBS bucket to which you have uploaded backup files.

    You can upload files in the .aof, .rdb, .zip, or .tar.gz format.

  6. Select the backup files whose data is to be migrated.
  7. Select the target instance created in Step 1: Prepare the Target DCS Redis Instance.
  8. Enter the password of the target instance. Click Test Connection to verify the password.
  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.