Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: dumpling和tidb-lighting是否可以备份和恢复某个分区数据
[TiDB Usage Environment] Production Environment / Testing / PoC
Production Environment
[TiDB Version]
5.2.1
[Reproduction Path] What operations were performed to cause the issue
Is it possible to use Dumpling to back up data from a specific partition and then use Lightning to restore it to another partition? This could significantly reduce data transfer time.
[Encountered Issues: Issue Phenomenon and Impact]
[Resource Configuration]
[Attachments: Screenshots / Logs / Monitoring]
Dumping is a logical export and supports table-filter, so exporting data from a specific partition is definitely not a problem. However, when you restore, you can’t specify which partition to restore to. It depends on how your partition table is constructed.
Can Dumpling be used to back up data from a specific partition?
Use the --where
option to filter data
I understand that restoring with Lightning to a specified partition means restoring to a specific sub-table?
The 5.2 version of Lightning supports routes rules, you can check it out:
# Set the sharding merge rules to import table1 and table2 from my_db1, and table3 and table4 from my_db2, a total of 4 tables from 2 databases, into the table5 table in the target database my_db.
# [[routes]]
# schema-pattern = "my_db1"
# table-pattern = "table[1-2]"
# target-schema = "my_db"
# target-table = "table5"
#
# [[routes]]
# schema-pattern = "my_db2"
# table-pattern = "table[3-4]"
# target-schema = "my_db"
# target-table = "table5"
FYI: TiDB Lightning 配置参数 | PingCAP 文档中心
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.