- What's New
- Product Bulletin
- Service Overview
- Billing
- Getting Started
-
User Guide
- Function Overview
- Kernel Version Notes
- Permissions Management
-
Instance Management
- Instance Statuses
- Buying a DDM instance
- Splitting Read-only and Read-Write Services
- Changing Node Class
- Scaling Out a DDM Instance
- Scaling In a DDM Instance
- Restarting a DDM Instance or an Instance Node
- Deleting Pay-per-Use Instances
- Reloading Table Data
- Changing a Parameter Template
- Modifying Parameters of a DDM Instance
- Rolling Back the Version of a DDM Instance
- Upgrading the Version of a DDM Instance
- Upgrading the DDM Engine and OS
- Connection Management
- Schema Management
- Shard Configuration
- Data Nodes
-
Parameter Template Management
- Instance Parameters
- Creating a Parameter Template
- Modifying a Custom Parameter Template
- Comparing Two Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying the Description of a Parameter Template
- Deleting a Parameter Template
- Account Management
- Backups and Restorations
-
Data Migration
- Overview
- Migration Evaluation
- Scenario 1: Migrating Data from an On-Premises MySQL Instance to DDM
- Scenario 2: Migrating Data from a Third-Party Cloud MySQL Instance to DDM
- Scenario 3: Migrating Data from an ECS-hosted MySQL Instance on Huawei Cloud to DDM
- Scenario 4: Exporting Data from a DDM Instance
- Scenario 5: Migrating Data from Heterogeneous Databases to DDM
- Scenario 6: Migrating Data from Huawei Cloud RDS for MySQL to DDM
- Session Management
- Slow Queries
- Monitoring and Alarm Reporting
- Task Center
- Tags
- Auditing
-
SQL Syntax
- Introduction
- DDL
- DML
- Online DDL
- Functions
- Unsupported Objects and Use Constraints
- Supported SQL Statements
- Global Sequence
- Database Management Syntax
- Advanced SQL Functions
- Quotas
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs (Recommended)
-
DDM Instances
- Buying a DDM instance
- Querying DDM Instances
- Querying Details of a DDM Instance
- Modifying the Name of a DDM Instance
- Changing the Security Group of a DDM Instance
- Deleting a DDM Instance
- Restarting a DDM Instance
- Reloading Table Data
- Scaling Out a DDM Instance
- Scaling in a DDM instance
- Modifying the Read Policy of the Associated DB Instance
- Synchronizing Data Node Information
- Querying Nodes of a DDM Instance
- Querying Details of a DDM Instance Node
- Querying Parameters of a Specified DDM Instance
- Modifying Parameters of a DDM Instance
- Querying DDM Engine Information
- Querying DDM Node Classes Available in an AZ
- Changing the Node Class of a DDM Instance
- Obtaining the Instance Group Information
- Creating an Instance Group
- Schemas
- Accounts
- Monitoring
- Session Management
- Application Examples
-
DDM Instances
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
Best Practices
- Overview
- Formulating Sharding Rules
- Determining the Number of Shards in a Schema
- Using Broadcast and Unsharded Tables
- Transaction Models
- SQL Standards
- Migrating an Entire RDS Database to DDM
- Migrating an Entire MyCat Database to DDM
- Accessing DDM Using a JDBC Connection Pool
- Logging In to a DDM Instance Using Navicat
- Migrating Data from RDS for MySQL to DDM Using DRS
- Sharding Database and Table Data of an RDS for MySQL Instance
- Performance White Paper
-
FAQs
- General Questions
-
DDM Usage
- How Does DDM Perform Sharding?
- What Do I Do If I Fail to Connect to a DDM Instance Using the JDBC Driver?
- Why It Takes So Long Time to Export Data from MySQL Using mysqldump?
- What Do I Do If a Duplicate Primary Key Error Occurs When Data Is Imported into DDM?
- What Should I Do If an Error Message Is Returned When I Specify an Auto-Increment Primary Key During Migration?
- What Do I Do If an Error Is Reported When Parameter Configuration Does Not Time Out?
- Which Should I Delete First, a Schema or its Associated RDS Instances?
- Can I Manually Delete Databases and Accounts Remained in Data Nodes After a Schema Is Deleted?
- SQL Syntax
-
RDS-related Questions
- Is the Name of a Database Table Case-Sensitive?
- What Risky Operations on RDS for MySQL Will Affect DDM?
- How Do I Handle Data with Duplicate Primary Keys in a Table?
- How Can I Query RDS for MySQL Information by Running Command show full innodb status?
- What Should I Pay Attention to When Selecting RDS for MySQL Instance Specifications?
- Connection Management
- Resource Freezing, Release, Deletion, and Unsubscription
- Videos
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Getting Started
- Function Overview
- Instance Management
-
Parameter Template Management
- Creating a Parameter Template
- Editing a Parameter Template
- Comparing Two Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying the Description of a Parameter Template
- Deleting a Parameter Template
- Task Center
- Schema Management
- Account Management
- Backup Management
- Monitoring Management
- Auditing
-
SQL Syntax
- Introduction
- DDL
- DML
- Functions
- Unsupported Items
- Supported SQL Statements
- Global Sequence
- Database Management Syntax
- Advanced SQL Functions
-
FAQs
- General Questions
-
DDM Usage
- How Can I Rectify a Fault in Accessing DDM by Using the JDBC Driver?
- What Version and Parameters Should I Select?
- Why It Takes So Long Time to Export Data from MySQL Using mysqldump?
- How Should I Handle the Duplicate Primary Key Error Occurring After Data Is Imported into DDM?
- What Should I Do If an Error Message Is Returned After I Specify an Auto-Increment Primary Key?
- How Do I Handle the Error Reported When Parameter Configuration Does Not Time Out?
- Which Should I Delete First, Schema or Associated RDS DB Instances?
- Should I Manually Delete Databases and Accounts Remained in the Associated RDS DB Instances After a Schema Is Deleted?
- SQL Syntax
- RDS-related Questions
- Connection Management
-
User Guide (Kuala Lumpur Region)
- Service Overview
- Getting Started
- Function Overview
- Instance Management
-
Parameter Template Management
- Creating a Parameter Template
- Editing a Parameter Template
- Comparing Two Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying the Description of a Parameter Template
- Deleting a Parameter Template
- Task Center
- Schema Management
- Account Management
- Backup Management
- Monitoring Management
- Auditing
-
SQL Syntax
- Introduction
- DDL
- DML
- Functions
- Unsupported Items
- Supported SQL Statements
- Global Sequence
- Database Management Syntax
- Advanced SQL Functions
-
FAQs
- General Questions
-
DDM Usage
- How Can I Rectify a Fault in Accessing DDM by Using the JDBC Driver?
- What Version and Parameters Should I Select?
- Why It Takes So Long Time to Export Data from MySQL Using mysqldump?
- How Should I Handle the Duplicate Primary Key Error Occurring After Data Is Imported into DDM?
- What Should I Do If an Error Message Is Returned After I Specify an Auto-Increment Primary Key?
- How Do I Handle the Error Reported When Parameter Configuration Does Not Time Out?
- Which Should I Delete First, Schema or Associated RDS DB Instances?
- Should I Manually Delete Databases and Accounts Remained in the Associated RDS DB Instances After a Schema Is Deleted?
- SQL Syntax
- RDS-related Questions
- Connection Management
-
API Reference (Kuala Lumpur Region)
- Before You Start
- API Overview
- Calling APIs
-
DDM Instance Management
- Querying DDM Engine
- Querying the Quota of Classes Available in Each AZ
- Creating a DDM Instance
- Querying DDM Instances
- Viewing Details of a DDM Instance
- Modifying the Name of a DDM Instance
- Modifying the Security Group of a DDM Instance
- Deleting a DDM Instance
- Restarting a DDM Instance
- Reloading Table Data
- Scaling Out a DDM instance
- Scaling In a DDM instance
- Modifying the Read Policy of the Associated DB Instance
- Synchronizing DB Instance Data
- Querying Nodes of a DDM Instance
- Querying Details of a DDM Instance Node
- Querying Parameters of a Specified DDM Instance
- Modifying Parameters of a DDM Instance
- Schema Management
- Account Management
- Monitoring Management
- Permissions Policies and Supported Actions
- Appendix
- Change History
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Migrating an Entire RDS Database to DDM
Scenario
This section describes how to migrate an entire RDS instance (the old RDS instance) to an unsharded schema of a DDM instance to split read and write requests in DDM.
- Services may be interrupted during migration. The duration of the interruption depends on the amount of data to be migrated and on network conditions.
- Data migration is complicated and is recommended during off-peak hours. This guide is for reference only. The actual migration scheme you should use depends on your specific service scenarios, the amount of data to be migrated, and how much downtime can be tolerated.
- If a large amount of data is involved, contact DDM technical engineers by submitting a service ticket or through after-sales services. Fully rehearse the migration before migrating data.
Preparations before Migration
- Prepare an ECS that can access the old RDS instance, the target DDM instance, and the RDS instance associated with the target DDM instance.
- Ensure that the old RDS instance, the target DDM instance, and the RDS instance associated with the target DDM instance are in the same VPC for network connectivity.
- Configure the same security group for the above-mentioned instances. If they belong to different security groups, enable the required ports.
- Install an official MySQL client on the ECS. Version 5.6 or 5.7 is recommended.
- Red Hat Enterprise Linux: yum install mysql mysql-devel
- Debian Linux: apt install mysql-client-5.7 mysql-client-core-5.7
- Ensure that there is enough disk space and memory on the ECS to store and compare dump files.
- Prepare a DDM instance that has been associated with an RDS instance, and configure the required DDM account and DDM schema for it.
- If the target schema is sharded, create a logical table with the same structure as data tables in the old RDS instance on the DDM console.
Constraints
- To ensure data integrity, stop services in the old RDS instance before data migration.
- In this scenario, associating the old RDS instance with DDM does not mean data association. You need to export data from the old RDS instance and then import it into the DDM instance.
- The version of the RDS instance associated with the target DDM instance must be consistent with the MySQL version of the old RDS instance.
Exporting Data from the Old RDS Instance
- Log in to the target ECS.
- Run the following command to export structure data. Set parameters in italics to actual values. For details about the parameters, see Table 1.
mysqldump -h {DB_ADDRESS} -P {DB_PORT} -u {DB_USER} -p --skip-lock-tables --add-locks=false --set-gtid-purged=OFF --no-data {DB_NAME} > {mysql_schema.sql}
Table 1 Parameter description Parameter
Description
Remarks
DB_ADDRESS
Connection address of the database whose data is to be exported
Mandatory
DB_PORT
Listening port of the database
Mandatory
DB_USER
Database user
Mandatory
DB_NAME
Database name
Mandatory
mysql_schema.sql
Name of the table structure file
The file name varies depending on the table whose structure is exported.
You are advised to name the file in the format of schema name_schema to prevent data from being overwritten, for example, mysql_schema.sql.
mysql_data.sql
Name of the database data file
N/A
- Run the following command to export data of the entire database. Set the parameters in italics. For details, see Table 1.
mysqldump -h {DB_ADDRESS} -P {DB_PORT} -u {DB_USER} -p --hex-blob --complete-insert --skip-lock-tables --skip-tz-utc --skip-add-locks --set-gtid-purged=OFF --no-create-info {DB_NAME} > {mysql_data.sql}
- Run the following command on the ECS to view the SQL files exported in 2 and 3.
ls -l
Importing Data into DDM
- Run the following command on the ECS to import the structure file into DDM:
mysql -f -h {DDM_ADDRESS} -P {DDM_PORT} -u {DDM_USER} -p {DB_NAME} < {mysql_schema.sql} Enter password: **********
Table 2 Parameter description Parameter
Description
Remarks
DDM_ADDRESS
Connection address of the DDM instance into which data is to be imported
View the floating IP address and port number on the Basic Information tab on the DDM console.
DDM_PORT
Listening port of the DDM instance into which data is to be imported
DDM_USER
User accessing the DDM instance
Account for creating a schema. The account must have both read and write permissions.
DB_NAME
Name of the schema into which data is to be imported
N/A
mysql_schema.sql
Name of the structure file to be imported
Name of the file exported in 2
mysql_data.sql
Name of the entire DB data file to be imported
Name of the file exported in 3
- Run the following command on the ECS to import the data file into DDM:
mysql -f -h {DDM_ADDRESS} -P {DDM_PORT} -u {DDM_USER} -p {DB_NAME} < {mysql_data.sql} Enter password: **********
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