How to Back Up a TiDB Database of 2.7TB While Excluding a 2.2TB Table

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TIDB数据库2.7T其中一个表2.2T 现在想备份这个库 请问如何备份的时候排除2.2T的表

| username: TiDBer_freGslX6

【TiDB Usage Environment】Production Environment
【TiDB Version】4.0.x
【Encountered Issues: Issue Phenomenon and Impact】
【Resource Configuration】
【Attachments: Screenshots/Logs/Monitoring】

| username: TiDBer_freGslX6 | Original post link

Could you give me some guidance?

| username: 像风一样的男子 | Original post link

I had this situation before as well. I wrote a script to list all the tables and used BR to back them up one by one.

| username: tidb菜鸟一只 | Original post link

br ./br backup db --db dbname -f '!dbname.tablename' -s 'local:///tmp/backup'
dumpling ./dumpling -f '!dbname.tablename' -P 3306 -o /tmp/data/ -B dbname
| username: TiDBer_freGslX6 | Original post link

Thank you, boss. I’ll go study the commands you sent.

| username: TiDBer_freGslX6 | Original post link

The person below you should be using a similar method, it looks simpler~

| username: TiDBer_freGslX6 | Original post link

Does not support -f :pensive:

| username: 像风一样的男子 | Original post link

What is your complete br command? I see that the official documentation supports the -f option.

| username: Kongdom | Original post link

Version 4.0 should allow you to directly use the -table option to specify table backups, or use table filter rules.

| username: Kongdom | Original post link

Try using the following instead, and it’s best not to copy directly as there might be issues with punctuation marks between Chinese and English:
--filter

| username: TiDBer_freGslX6 | Original post link

I might know the reason. I used br backup db -f, which doesn’t work. I need to use br backup full -f. I’ll try again tomorrow.

| username: TiDBer_freGslX6 | Original post link

Thank you, boss. The -f option should work. I used the wrong command before. I’ll confirm it again tomorrow~

| username: cassblanca | Original post link

Specify table backup.

| username: redgame | Original post link

-f ‘!dbname.tablename’ We are also using this.

| username: TiDBer_freGslX6 | Original post link

Got it done, folks.

| username: Kongdom | Original post link

:+1: :+1: :+1:

| username: 像风一样的男子 | Original post link

Learned something new again.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.