tencent cloud

TDSQL Boundless

Release Notes
Product Introduction
Overview
Scenarios
Product Architecture
Instance Types
Compatibility Notes
Kernel Features
Kernel Overview
Kernel Version Release Notes
Functionality Features
Performance Features
Billing
Billing Overview
Purchase Method
Pricing Details
Renewal
Overdue Payments
Refund
Getting Started
Creating an Instance
Connect to Instances
User Guide
Data Migration
Data Subscription
Instance Management
Configuration Change
Parameter Configuration
Account Management
Security Group
Backup and Restoration
Database Auditing
Tag Management
Use Cases
Technical Evolution and Usage Practices of Online DDL
Lock Mechanism Analysis and Troubleshooting Practices
Data Intelligent Scheduling and Related Practices for Performance Optimization
TDSQL Boundless Selection Guide and Practical Tutorial
Developer Guide
Developer Guide (MySQL Compatibility Mode)
Developer Guide (HBase Compatibility Mode)
Performance Tuning
Performance Tuning Overview
SQL Tuning
DDL Tuning
Performance White Paper
Performance Overview
TPC-C Test
Sysbench Test
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Security Group APIs
Task APIs
Backup APIs
Rollback APIs
Parameter APIs
Database APIs
Data Types
Error Codes
General Reference
System Architecture
SQL Reference
Database Parameter Description
TPC-H benchmark data model reference
Error Code Information
Security and Compliance
FAQs
Agreements
Service Level Agreement
Terms of Service
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary
DocumentaçãoTDSQL BoundlessUser GuideData MigrationMigrating from Large-Scale TiDB Instances to TDSQL Boundless

Migrating from Large-Scale TiDB Instances to TDSQL Boundless

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-03-12 09:43:58
This document describes how to migrate data from a self-hosted TiDB cluster to TDSQL Boundless using the tidb2tdsql tool, Bulk Load, and the TiCDC incremental data synchronization tool.

Overall Process

1. Set up the environment and prepare the tools.
2. Migrate full data. The process is as follows:
2.1 Use the BR tool to perform a full backup of the self-built TiDB cluster to Tencent Cloud COS, and record the full backup point in time.
2.2 Use the tidb2tdsql tool to convert TiDB backup data into SQL files and store them in Tencent Cloud COS.
2.3 Data is imported via SQL files from Tencent Cloud COS to TDSQL Boundless.
3. Use TiCDC to synchronize incremental data.
4. Verify the migrated data.

Prerequisites

It is recommended to place the Tencent Cloud COS Bucket and TDSQL Boundless instance in the same region, as cross-region deployment may affect migration performance. Before proceeding, ensure you have the following prepared:
a Tencent Cloud COS Bucket
a TDSQL Boundless instance
tidb2tdsql: a tool that conveniently converts TiDB snapshot backup data to SQL files.
TiCDC: TiDB's incremental data synchronization tool.

Deploy the BR Tool

1. Prepare the deployment environment.
Deploy BR on a server that has network connectivity with both the source MySQL/TiDB and target TDSQL Boundless instances.
2. Use TiUP to deploy BR.
## Deploying TiUP
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
source /root/.bash_profile

## Deploying and Upgrading BR to the Latest Version
tiup install br
tiup update --self && tiup update br

Deploy TiDB2TDSQL

1. Prepare the deployment environment.
Deploy TiDB2TDSQL on a server that has network connectivity with both the source MySQL/TiDB and target TDSQL Boundless instances.
2. Contact Tencent Cloud Technical Support to obtain the data conversion tool.
## Deploying the TiDB2TDSQL Tool
chmod +x bin/tidb2tdsql

Deploying TiCDC

You need to deploy TiCDC to synchronize incremental data from the upstream TiDB cluster to the TDSQL Boundless instance. For deploying the TiCDC tool, refer to: Using TiUP to Add or Scale Out TiCDC in an Existing TiDB Cluster.

Full data migration

To migrate data from a self-built TiDB cluster to a TDSQL Boundless instance, please perform a full data migration by following these steps:
1. You can perform a full backup of your self-built TiDB cluster to COS storage using the BR tool.
2. View and record the backup timestamp information TSO.
3. Use the tidb2tdsql tool to convert TiDB backup data into SQL files and store them in Tencent Cloud COS.
4. Data is imported via SQL files from Tencent Cloud COS to TDSQL Boundless.

Back Up TiDB to COS Storage

You need to deploy the BR tool to back up data from the self-built TiDB cluster to Tencent Cloud COS storage.
# Obtaining the secret_id and secret_key for a Tencent Cloud COS Bucket
export AWS_ACCESS_KEY_ID=${cos_secret_id}
export AWS_SECRET_ACCESS_KEY=${cos_secret_key}
tiup br backup full --pd "${PD_IP}:2379" \\
--storage "s3://db_br?endpoint=https://source_address.cos.ap-guangzhou.myqcloud.com?AWS_ACCESS_KEY_ID=${cos_secret_id}&AWS_SECRET_ACCESS_KEY=${cos_secret_key}" \\
--s3.region="ap-guangzhou" \\
--s3.provider="cos"

View and Record the Backup Timestamp Information

View and record the timestamp information of the full backup. The full backup timestamp TSO serves as the starting point for incremental data. You can run the following command:
# Obtaining the secret_id and secret_key for a Tencent Cloud COS Bucket
export AWS_ACCESS_KEY_ID=${cos_secret_id}
export AWS_SECRET_ACCESS_KEY=${cos_secret_key}

tiup br validate decode --field="end-version" \\
--storage
"s3://db_br?endpoint=https://source_address.cos.ap-guangzhou.myqcloud.com" \\
--s3.region="ap-guangzhou" \\
--s3.provider="cos" | tail -n1
The output is as follows. Record this timestamp to be used as the starting point for subsequent incremental data synchronization:
463592975341191170

Convert Backup Data Format

By running the following command, convert TiDB backup data into SQL files and store them in Tencent Cloud COS:
# Obtaining the secret_id and secret_key for a Tencent Cloud COS Bucket
export AWS_ACCESS_KEY_ID=${cos_secret_id}
export AWS_SECRET_ACCESS_KEY=${cos_secret_key}

bin/tidb2tdsql dump --worker-count 64 \\
--storage "s3://db_br?endpoint=https://source_address.cos.ap-guangzhou.myqcloud.com" \\
--s3.region="ap-guangzhou" \\
--s3.provider="cos" \\
--output "s3://db_tdsql?endpoint=https://target_address.cos.ap-guangzhou.myqcloud.com"

Check Converted Data

Check the exported data. Usually, the exported data includes the following content:
metadata: contains the export start time TSO.
{schema}-schema-create.sql: SQL file to create schema
{schema}.{table}-schema.sql: SQL file to create table
{schema}.{table}.{000000001}.{sql}: data file stored by shard
{schema}.{view}-schema-view.sql: SQL file for the view.
$ cat metadata
# Started dump at: 2026-01-15 17:54:08

[myloader_session_variables]
SQL_MODE='NO_ENGINE_SUBSTITUTION'

[config]
max-statement-size = 1048576

# SHOW MASTER STATUS:
# Log: tidb-br-dump
# Pos: 463592975341191170
# GTID:
# Finished dump at: 2026-01-15 17:54:36

Import to TDSQL Boundless

Import fully converted SQL files to TDSQL Boundless instance. For details, please contact Tencent Cloud technical support.

Synchronize Incremental Data

To synchronize incremental data, refer to the steps in synchronizing data to MySQL-compatible databases via TiCDC. The starting point for incremental data migration is the full data export timestamp TSO. Taking the backup example above, this corresponds to the output 463592975341191170 in the example.

Start Incremental Synchronization Task

If after an incremental synchronization task is created, the output shows Create changefeed successfully, then the synchronization task is created successfully.
If the CDC task status shows normal, the synchronization task is running normally.
tiup cdc cli changefeed list --pd=http://172.16.6.122:2379
[
{
"id": "totdsqlc",
"summary": {
"state": "normal",
"tso": 463592975341191170,
"checkpoint": "2026-01-15 17:54:36.270",
"error": null
}
}
]

Check on data consistency

You can use the sync-diff-inspector tool to verify the consistency of upstream and downstream data. For the configuration of the config.yaml file, refer to the following file:
# Diff Configuration.
######################### Datasource config #########################
[data-sources]
[data-sources.upstream]
host = "172.20.6.11" # needs to be replaced with the actual upstream cluster ip
port = 4000
user = "root"
password = "YourPassword"
snapshot = "436138236720447494" # set to the actual backup timestamp TSO

[data-sources.downstream]
host = "172.20.6.88" # needs to be replaced with the actual downstream cluster ip
port = 3306
user = "root"
password = "YourPassword"
######################### Task config #########################
[task]
output-dir = "./output"
source-instances = ["upstream"]
target-instance = "downstream"
target-check-tables = ["*.*"]

Ajuda e Suporte

Esta página foi útil?

comentários