Backup Import Between DCS Redis Instances
You can migrate data between DCS instances by importing backup files.
- If the source Redis and target Redis are in the same region under the same DCS account, and the source Redis is not a single-node instance, see Importing Backup Data from a Redis Instance.
- If the source Redis and target Redis are in different regions or under different DCS accounts, or the source Redis is a single-node instance, see Importing Backup Data from an OBS Bucket.
Prerequisites
- You have successfully backed up the source Redis instance.
- For Importing Backup Data from a Redis Instance, you do not need to download the backup file to the local PC. For details about how to back up data, see Manually Backing Up a DCS Instance.
- For Importing Backup Data from an OBS Bucket, download the backup file to the local PC by referring to Downloading a Backup File.
- You have prepared the target Redis instance. If a target DCS Redis instance is not available, create one first. For details, see Buying a DCS Redis Instance.
Redis is backward compatible. The target instance version must be the same as or later than the source instance version.
- Ensure that the target Redis instance has sufficient storage space. You can 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.
Importing Backup Data from a Redis Instance
- Log in to the DCS console.
- Click in the upper left corner of the console and select the region where your source and target instances are located.
- In the navigation pane, choose Data Migration. The migration task list is displayed.
- Click Create Backup Import Task.
- 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 (_).
- For source Redis, set Data Source to Redis.
Figure 1 Selecting a data source (Redis)
- For Source Redis Instance, select the source instance to be migrated.
- You can specify Source DB to migrate data from the specified DB in the source Redis backup file. For example, if you enter 5, only data in DB5 will be migrated. To migrate all databases, do not specify Source DB.
- Enable Multi-DB Proxy Cluster if the source Redis is a multi-DB (multi-db set to yes) Proxy Cluster DCS Redis instance.
- Select the backup task whose data is to be migrated.
- For Target Redis Instance, select the DCS Redis instance prepared in Prerequisites.
- 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.
- 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?
- Click Next.
- 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.
Importing Backup Data from an OBS Bucket
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 backup import task, data in the OBS bucket will be read and migrated to the target Redis.
- .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.
- To migrate data from a cluster Redis instance, download all backup files and upload all of them to the OBS bucket. Each backup file contains data for a shard of the instance. During the migration, you need to select backup files of all shards.
- Create an OBS bucket in the account and region where the target Redis instance is located. If a qualified OBS bucket is available, you do not need to create one.
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.
- Region:
The OBS bucket must be in the same region as the target DCS Redis instance.
- Default Storage Class: Select Standard or Infrequent Access.
Do not select Archive. Otherwise, the migration will fail.
- Region:
- Upload the backup file to the OBS bucket.
- In the bucket list, click the name of the created bucket.
- In the navigation pane, choose Objects.
- On the Objects tab page, click Upload Object.
- Specify Storage Class.
Do not select Archive. Otherwise, the migration will fail.
- 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.
Figure 2 Uploading an object
- Specify Server-Side Encryption. If you enable it, you can select SSE-KMS or SSE-OBS. You can also disable it. For details, see Enabling Server-Side Encryption When Uploading an Object.
- Click Upload.
- Click in the upper left corner and choose Distributed Cache Service for Redis under Middleware to open the DCS console.
- In the navigation pane, choose Data Migration.
- Click Create Backup Import Task.
- 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 (_).
- In the Source Redis area, select OBS Bucket for Data Source and then select the OBS bucket to which you have uploaded backup files.
Figure 3 Selecting a data source (OBS bucket)
- You can specify Source DB to migrate data from the specified DB in the source Redis backup file. For example, if you enter 5, only data in DB5 will be migrated. To migrate all databases, do not specify Source DB.
- Enable Multi-DB Proxy Cluster if the source Redis is a multi-DB (multi-db set to yes) Proxy Cluster DCS Redis instance.
- Click Add Backup and select the backup files to be migrated.
- In the Target Redis area, select the Target Redis Instance prepared in Prerequisites.
- 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.
- 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?
- Click Next.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot