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

Migrating Data from MySQL to DWS

Updated on 2023-02-06 GMT+08:00

Scenario

CDM supports table-to-table data migration. This section describes how to migrate data from MySQL to DWS. The process is as follows:

  1. Creating a CDM Cluster and Binding an EIP to the Cluster
  2. Creating a MySQL Link
  3. Creating a DWS Link
  4. Creating a Migration Job

Prerequisites

  • You have obtained the IP address, port number, database name, username, and password for connecting to DWS. In addition, you must have the read, write, and delete permissions on the DWS database.
  • You have obtained the IP address, port, database name, username, and password for connecting to the MySQL database. In addition, the user must have the read and write permissions on the MySQL database.
  • You have uploaded a MySQL database driver by following the instructions provided in Managing Drivers.

Creating a CDM Cluster and Binding an EIP to the Cluster

  1. Create a CDM cluster by following the instructions in Creating a Cluster.

    The key configurations are as follows:

    • The flavor of the CDM cluster is selected based on the amount of data to be migrated. Generally, cdm.medium meets the requirements for most migration scenarios.
    • The VPC, subnet, and security group of the CDM cluster must be the same as those of the DWS cluster.

  2. After the CDM cluster is created, on the Cluster Management page, click Bind EIP in the Operation column to bind an EIP to the cluster. The CDM cluster uses the EIP to access MySQL.

    NOTE:

    If SSL encryption is configured for the access channel of a local data source, CDM cannot connect to the data source using the EIP.

Creating a MySQL Link

  1. On the Cluster Management page, locate a cluster and click Job Management in the Operation column. On the displayed page, click the Links tab and then Create Link.
  2. Select MySQL and click Next. On the page that is displayed, configure MySQL link parameters.

    Click Show Advanced Attributes and set optional parameters. For details, see Link to a Common Relational Database. Retain the default values of the optional parameters and configure the mandatory parameters according to Table 1.

    Table 1 MySQL link parameters

    Parameter

    Description

    Example Value

    Name

    Unique link name

    mysqllink

    Database Server

    IP address or domain name of the MySQL database server

    192.168.1.110

    Port

    MySQL database port

    3306

    Database Name

    Name of the MySQL database

    sqoop

    Username

    User who has the read, write, and delete permissions on the MySQL database

    admin

    Password

    Password of the user

    -

    Use Agent

    Whether to extract data from the data source through an agent

    Yes

    Agent

    Click Select to select the agent created in .

    -

  3. Click Save. The Link Management page is displayed.

    NOTE:

    If an error occurs during the saving, the security settings of the MySQL database are incorrect. In this case, you need to enable the EIP of the CDM cluster to access the MySQL database.

Creating a DWS Link

  1. On the Cluster Management page, locate a cluster and click Job Management in the Operation column. On the displayed page, click the Links tab and then Create Link.
  2. Select Data Warehouse Service and click Next to configure the DWS link parameters. Set the mandatory parameters listed in Table 2 and retain the default values for the optional parameters.

    Table 2 DWS link parameters

    Parameter

    Description

    Example Value

    Name

    Enter a unique link name.

    dwslink

    Database Server

    IP address or domain name of the DWS database

    192.168.0.3

    Port

    DWS database port

    8000

    Database Name

    Name of the DWS database

    db_demo

    Username

    User who has the read, write, and delete permissions on the DWS database

    dbadmin

    Password

    Password of the user

    -

    Use Agent

    Whether to extract data from the data source through an agent

    Yes

    Agent

    Click Select and select the agent created in Connecting to an Agent.

    -

    Import Mode

    COPY: Migrate the source data to the DWS management node and then copy the data to DataNodes. To access DWS through the Internet, select COPY.

    COPY

  3. Click Save.

Creating a Migration Job

  1. Choose Table/File Migration > Create Job to create a job for exporting data from the MySQL database to DWS.

    Figure 1 Creating a job for migrating data from MySQL to DWS
    • Job Name: Enter a unique name.
    • Source Job Configuration
      • Source Link Name: Select the mysqllink created in Creating a MySQL Link.
      • Use SQL Statement: Select No.
      • Schema/Tablespace: name of the schema or tablespace from which data is to be extracted
      • Table Name: name of the table from which data is to be extracted
      • Retain the default values of other optional parameters. For details, see From a Common Relational Database.
    • Destination Job Configuration
      • Destination Link Name: Select the dwslink created in Creating a DWS Link.
      • Schema/Tablespace: Select the DWS database to which data is to be written.
      • Auto Table Creation: This parameter is displayed only when both the migration source and destination are relational databases.
      • Table Name: Name of the table to which data is to be written. You can enter a table name that does not exist. CDM automatically creates the table in DWS.
      • isCompress: whether to compress data. If you select Yes, high-level compression will be performed. CDM applies to compression scenarios where the I/O read/write volume is large and the CPU is sufficient (the computing load is relatively low).
      • Orientation: You can create row- or column-store tables as needed. Generally, if a table contains many columns (called a wide table) and its query involves only a few columns, column storage is recommended. If a table contains only a few columns and a query includes most of the fields, row storage is recommended.
      • Extend char length: If the data encoding formats of the migration source and destination are different, the character length of the automatic table creation may be insufficient. If you select Yes for this parameter, the character length will be increased by three times during automatic table creation.
      • Clear Data Before Import: whether to clear data in the destination table before the migration task starts.

  2. Click Next. The Map Field page is displayed. CDM automatically matches the source and destination fields, as shown in Figure 2.

    • If the field mapping is incorrect, you can drag the fields to adjust the mapping.
    • You can map fields in batches.
    • The expressions in CDM support field conversion of common character strings, dates, and values.
    Figure 2 Table-to-table field mapping

  3. Click Next and set task parameters. Generally, retain the default values of all parameters.

    In this step, you can configure the following optional functions:
    • Retry Upon Failure: If the job fails to be executed, you can determine whether to automatically retry. Retain the default value Never.
    • Group: Select the group to which the job belongs. The default group is DEFAULT. On the Job Management page, jobs can be displayed, started, or exported by group.
    • Schedule Execution: To configure scheduled jobs, see Scheduling Job Execution. Retain the default value No.
    • Concurrent Extractors: Enter the number of extractors to be concurrently executed. You can increase the value of this parameter to improve migration efficiency.
    • Write Dirty Data: Dirty data may be generated during data migration between tables. You are advised to select Yes.
    • Delete Job After Completion: Retain the default value Do not delete.

  4. Click Save and Run. The Job Management page is displayed, on which you can view the job execution progress and result.
  5. After the job is successfully executed, in the Operation column of the job, click Historical Record to view the job's historical execution records and read/write statistics.

    On the Historical Record page, click Log to view the job logs.

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