How to use dumpling!

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

Original topic: dumpling怎么用!

| username: 点点-求助来了

[TiDB Usage Environment] Production Environment
[TiDB Version] 5.0.1
[Reproduction Path] Operations performed that led to the issue
[Encountered Issue: Issue Symptoms and Impact]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: TiDBer_yUoxD0vR | Original post link

Where did you download dumpling to? Please provide the full path.

| username: Ming | Original post link

First, you need to confirm whether you have installed Dumpling. The ./dumpling command uses the dumpling executable file. Check where it is installed, and then use the full path to specify it.

| username: 点点-求助来了 | Original post link

Where can I download it?

| username: 啦啦啦啦啦 | Original post link

| username: 点点-求助来了 | Original post link

[root@master ~]# tiup dumpling -u -root -P 4000 -H 192.168.30.141 --filetype sql -t 8 -o /home/tidb/databak/test -r 2000000 -B test
tiup is checking updates for component dumpling …
Starting component dumpling: /root/.tiup/components/dumpling/v5.4.2/dumpling -u -root -P 4000 -H 192.168.30.141 --filetype sql -t 8 -o /home/tidb/databak/test -r 2000000 -B test
unknown shorthand flag: ‘H’ in -H
Dumpling is a CLI tool that helps you dump MySQL/TiDB data

Usage:
dumpling [flags]

Flags:
–allow-cleartext-passwords Allow passwords to be sent in cleartext (warning: don’t use without TLS)
–azblob.access-tier string Specify the storage class for azblob
–azblob.account-key string Specify the account key for azblob
–azblob.account-name string Specify the account name for azblob
–azblob.endpoint string (experimental) Set the Azblob endpoint URL
–ca string The path name to the certificate authority file for TLS connection
–case-sensitive whether the filter should be case-sensitive
–cert string The path name to the client certificate file for TLS connection
–complete-insert Use complete INSERT statements that include column names
-c, --compress string Compress output file type, support ‘gzip’, ‘no-compression’ now
–consistency string Consistency level during dumping: {auto|none|flush|lock|snapshot} (default “auto”)
–csv-delimiter string The delimiter for values in csv files, default ‘"’ (default “"”)
–csv-null-value string The null value used when export to csv (default “\N”)
–csv-separator string The separator for csv files, default ‘,’ (default “,”)
-B, --database strings Databases to dump
–dump-empty-database whether to dump empty database (default true)
–escape-backslash use backslash to escape special characters (default true)
-F, --filesize string The approximate size of output file
–filetype string The type of export file (sql/csv)
-f, --filter strings filter to select which tables to dump (default [.,!/^(mysql|sys|INFORMATION_SCHEMA|PERFORMANCE_SCHEMA|METRICS_SCHEMA|INSPECTION_SCHEMA)$/.*])
–gcs.credentials-file string (experimental) Set the GCS credentials file path
–gcs.endpoint string (experimental) Set the GCS endpoint URL
–gcs.predefined-acl string (experimental) Specify the GCS predefined acl for objects
–gcs.storage-class string (experimental) Specify the GCS storage class for objects
–help Print help message and quit
-h, --host string The host to connect to (default “127.0.0.1”)
–key string The path name to the client private key file for TLS connection
-L, --logfile path Log file path, leave empty to write to console
–logfmt format Log format: {text|json} (default “text”)
–loglevel string Log level: {debug|info|warn|error|dpanic|panic|fatal} (default “info”)
-d, --no-data Do not dump table data
–no-header whether not to dump CSV table header
-m, --no-schemas Do not dump table schemas with the data
-W, --no-views Do not dump views (default true)
-o, --output string Output directory (default “./export-2023-04-22T11:09:55+08:00”)
–output-filename-template string The output filename template (without file extension)
–params stringToString Extra session variables used while dumping, accepted format: --params “character_set_client=latin1,character_set_connection=latin1” (default )
-p, --password string User password
-P, --port int TCP/IP port to connect to (default 4000)
-r, --rows uint If specified, dumpling will split table into chunks and concurrently dump them to different files to improve efficiency. For TiDB v3.0+, specify this will make dumpling split table with each file one TiDB region(no matter how many rows is).
If not specified, dumpling will dump table without inner-concurrency which could be relatively slow. default unlimited
–s3.acl string (experimental) Set the S3 canned ACLs, e.g. authenticated-read
–s3.endpoint string (experimental) Set the S3 endpoint URL, please specify the http or https scheme explicitly
–s3.provider string (experimental) Set the S3 provider, e.g. aws, alibaba, ceph
–s3.region string (experimental) Set the S3 region, e.g. us-east-1
–s3.sse string Set S3 server-side encryption, e.g. aws:kms
–s3.sse-kms-key-id string KMS CMK key id to use with S3 server-side encryption.Leave empty to use S3 owned key.
–s3.storage-class string (experimental) Set the S3 storage class, e.g. STANDARD
–snapshot string Snapshot position (uint64 or MySQL style string timestamp). Valid only when consistency=snapshot
-s, --statement-size uint Attempted size of INSERT statement in bytes (default 1000000)
–status-addr string dumpling API server and pprof addr (default “:8281”)
-T, --tables-list strings Comma delimited table list to dump; must be qualified table names
-t, --threads int Number of goroutines to use, default 4 (default 4)
–tidb-mem-quota-query uint The maximum memory limit for a single SQL statement, in bytes.
-u, --user string Username with privileges to run the dump (default “root”)
-V, --version Print Dumpling version
–where string Dump only selected records
unknown shorthand flag: ‘H’ in -H

| username: 啦啦啦啦啦 | Original post link

Change -h to lowercase.

| username: TiDBer_pkQ5q1l0 | Original post link

Install dumpling using tiup, then go to the component directory under the .tiup directory and copy dumpling to the machine where you need to use dumpling.

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

./dumpling -h 10.10.10.16 -P 4000 -u root -p ****** -o /tmp/test --filetype sql -t 8 -r 200000 -F 256MiB -T test2.trun_tab --snapshot “2022-11-30 11:02:20”
Something like this.

| username: 点点-求助来了 | Original post link

tiup dumpling -u root -P 4000 -h 192.168.30.141 --filetype sql -t 8 -o /home/tidb/databak/test -r 2000000 -B test

| username: 点点-求助来了 | Original post link

This is how I completed it.

| username: system | Original post link

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