tencent cloud

TDSQL Boundless

DocumentaçãoTDSQL BoundlessUser GuideData MigrationMigrate Small Data Volume from TiDB Instance to TDSQL Boundless

Migrate Small Data Volume from TiDB Instance to TDSQL Boundless

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-07-17 16:30:03
Dumpling is a tool that exports TiDB data into SQL or CSV files. This document describes how to use Dumpling to export full data from a self-hosted TiDB cluster.

Prerequisites

1. Prepare the deployment environment.
It is recommended to deploy Dumpling on servers that have network connectivity with the source MySQL/TiDB and target TDSQL Boundless instances awaiting migration.
2. Deploy Dumpling with TiUP
## Deploy TiUP
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
source /root/.bash_profile

## Deploy Dumpling and upgrade to the latest version
tiup install dumpling
tiup update --self && tiup update dumpling
3. Configure the required permissions for Dumpling
You require the following permissions to export data from the upstream database:
SELECT
RELOAD
LOCK TABLES
REPLICATION CLIENT
PROCESS
4. You have obtained the TDSQL Boundless myloader tool.

Steps

The following example demonstrates how to export SQL files from TiDB using Dumpling, import them into TDSQL Boundless with TDSQL Boundless myloader, and enable TiCDC for incremental synchronization.
1. Disable the GC temporarily for the upstream TiDB cluster.
To ensure that newly written data is not lost during incremental migration, you should disable the garbage collection (GC) for the upstream cluster before the migration is started. In this way, history data is not deleted.
Run the following command to disable GC:
SET GLOBAL tidb_gc_enable = FALSE;
To verify that the change takes effect, query the value of tidb_gc_enable:
SELECT @@global.tidb_gc_enable;
The following is an example output, where 0 indicates disabled.
+-------------------------+
| @@global.tidb_gc_enable |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
2. Run Dumpling to export the full data as SQL files.
tiup dumpling -u root -P 4000 -h tidb_host -o /tmp/test
Dumpling exports data in SQL format by default. For partial data export or filtering, refer to the Dumpling usage instructions.
3. Check the exported data.
Typically, exported data includes the following:
metadata: contains the export start time and the binlog position of the master database
{schema}-schema-create.sql: SQL file for creating schema
{schema}.{table}-schema.sql: SQL file for creating tables
{schema}.{table}.{0001}.{sql|csv}: data file
*-schema-view.sql, *-schema-trigger.sql, *-schema-post.sql: other exported SQL files
Take the following metadata file as an example:
Started dump at: 2025-12-02 12:42:53
SHOW MASTER STATUS:
Log: tidb-binlog
Pos: 462583122654920710
GTID:

Finished dump at: 2025-12-02 12:42:53
The number after Pos is the TiDB timestamp used for the export. This timestamp will be used to set the TiCDC replay starting point for subsequent incremental migration.
4. Import Data
Import the data using the TDSQL Boundless myloader tool. In the following example, the directory specified by -d is the directory exported by Dumpling in the previous example.
myloader -h tdsql_host -P 3306 --user tdsqluser -d /tmp/test
5. Perform incremental synchronization using TiCDC. In the following example, set start-ts to the timestamp obtained from the Dumpling metadata. For details, refer to TiDB Official Documentation.
tiup cdc cli changefeed create --server=http://ticdc_host:8300 --sink-uri='mysql://tdsql_user@tdsql_host:3306' --changefeed-id="upstream-to-downstream" --start-ts="462583122654920710"
6. To resume GC of TiDB, run the following command:
SET GLOBAL tidb_gc_enable = TRUE;
To verify that the change takes effect, query the value of tidb_gc_enable:
SELECT @@global.tidb_gc_enable;
The expected output is 1, indicating that it is enabled:
+-------------------------+
| @@global.tidb_gc_enable |
+-------------------------+
| 1 |
+-------------------------+
1 row in set (0.00 sec)

Ajuda e Suporte

Esta página foi útil?

comentários