Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Self-Hosted Redis Migration with Backup Files

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

This section describes how to migrate self-hosted Redis to DCS by importing backup files.

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

Notes and Constraints

To migrate to an instance with SSL enabled, disable the SSL setting first. For details, see Transmitting DCS Redis Data with Encryption Using SSL.

Prerequisites

  • Before migrating data, read through Migration Solution Notes 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 from Another Cloud Using 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.

    Figure 1 Uploading an object

  7. Specify Server-Side Encryption. If you enable it, you can select SSE-KMS or SSE-OBS. You can also disable it. For details, see Server-Side Encryption.
  8. Click Upload.

Creating a Migration Task

  1. Click in the upper left corner and choose Distributed Cache Service for Redis under Middleware to open 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. You can specify Source DB to migrate data from the specified DB in the source backup file. For example, if you enter 5, only data in DB5 will be migrated. To migrate all databases, do not specify Source DB.
  7. Enable Multi-DB Proxy Cluster if the source Redis is a multi-DB (multi-db set to yes) Proxy Cluster DCS Redis instance.
  8. Click Add Backup and select the backup files to be migrated.
  9. In the Target Redis area, select the Target Redis Instance prepared in Prerequisites.
  10. 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.
  11. 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.

    NOTE:
    • 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?

  12. Click Next.
  13. 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.

Verifying the Migration

After the data is imported successfully, access the DCS instance and run the info command to check whether the data has been successfully imported as required. Connect to Redis by referring to redis-cli.

If the import fails, check the procedure. If the import command is incorrect, run the flushall or flushdb command to clear the cache data in the target instance, modify the import command, and try again.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback