Updated on 2024-11-26 GMT+08:00

Importing Backup Files from Redis

Scenario

Use the DCS console to migrate Redis data from self-hosted Redis to DCS for Redis.

Simply back up your Redis data, create a migration task on the DCS console, and then import the backup to a DCS Redis instance.

Prerequisites

A master/standby or cluster DCS Redis instance has been created as the target for the migration. The source instance has data and has been backed up.

  1. Importing backups generated by a later-version Redis instance to an earlier one may fail.
  2. Before importing backup files, ensure that resource-intensive commands (such as FLUSHALL, KEYS, and HGETALL) have been disabled on the target Redis.
  3. The Redis memory usage of a single .rdb backup file must be less than 10 GB.
  4. If the backup file contains multi-DB data, its database count cannot exceed what is supported by the target Redis.
  5. Multi-DB backup files generated from Proxy Cluster instances cannot be imported.

Step 1: Obtain the Source Instance Name and Password

Obtain the name of the source Redis instance.

Step 2: 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 can clear the instance data before the migration.
    • If the target instance is Redis 4.0 and later, clear the data by referring to Clearing DCS Instance Data.
    • If the target instance is a DCS Redis 3.0 instance, run the FLUSHALL command to clear data.
    • If the target 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.

Step 3: Create a Migration Task

  1. Log in to the DCS console.
  2. Click in the upper left corner and select a region and a project.
  3. In the navigation pane, choose Data Migration.
  4. Click Create Backup Import Task.
  5. Enter the task name and description.
  6. Set Data Source to Redis.
  7. For source Redis, select the instance prepared in Step 1: Obtain the Source Instance Name and Password.
  8. Select the backup task whose data is to be migrated.
  9. For Target Instance, select the DCS Redis prepared in Step 2: Prepare the Target DCS Redis Instance.
  10. Enter the password of the target instance. Click Test Connection to verify the password. If the instance is not password-protected, click Test Connection directly.
  11. Click Next.
  12. 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.