ticloud serverless export create

Export data from a TiDB Cloud Serverless cluster:

ticloud serverless export create [flags]

Examples

Export data from a TiDB Cloud Serverless cluster in interactive mode:

ticloud serverless export create

Export data from a TiDB Cloud Serverless cluster to a local file in non-interactive mode:

ticloud serverless export create -c <cluster-id> --filter <database.table>

Export data from a TiDB Cloud Serverless cluster to Amazon S3 in non-interactive mode:

ticloud serverless export create -c <cluster-id> --s3.uri <uri> --s3.access-key-id <access-key-id> --s3.secret-access-key <secret-access-key> --filter <database.table>

Export data from a TiDB Cloud Serverless cluster to Google Cloud Storage in non-interactive mode:

ticloud serverless export create -c <cluster-id> --gcs.uri <uri> --gcs.service-account-key <service-account-key> --filter <database.table>

Export data from a TiDB Cloud Serverless cluster to Azure Blob Storage in non-interactive mode:

ticloud serverless export create -c <cluster-id> --azblob.uri <uri> --azblob.sas-token <sas-token> --filter <database.table>

Export data to a Parquet file and compress it with SNAPPY in non-interactive mode:

ticloud serverless export create -c <cluster-id> --file-type parquet --parquet.compression SNAPPY --filter <database.table>

Export data with SQL statements in non-interactive mode:

ticloud serverless export create -c <cluster-id> --sql 'select * from database.table'

Flags

In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in.

FlagDescriptionRequiredNote
-c, --cluster-id stringSpecifies the ID of the cluster, from which you want to export data.YesOnly works in non-interactive mode.
--file-type stringSpecifies the export file type. One of ["SQL" "CSV" "PARQUET"]. (default "CSV")NoOnly works in non-interactive mode.
--target-type stringSpecifies the export target. One of ["LOCAL" "S3" "GCS" "AZURE_BLOB"]. The default value is "LOCAL".NoOnly works in non-interactive mode.
--s3.uri stringSpecifies the S3 URI in s3://<bucket>/<file-path> format. Required when the target type is S3.NoOnly works in non-interactive mode.
--s3.access-key-id stringSpecifies the access key ID of Amazon S3. You only need to set one of the s3.role-arn and [s3.access-key-id, s3.secret-access-key].NOOnly works in non-interactive mode.
--s3.secret-access-key stringSpecifies the secret access key of Amazon S3. You only need to set one of the s3.role-arn and [s3.access-key-id, s3.secret-access-key].NoOnly works in non-interactive mode.
--s3.role-arn stringSpecifies the role ARN of Amazon S3. You only need to set one of the s3.role-arn and [s3.access-key-id, s3.secret-access-key].NoOnly works in non-interactive mode.
--gcs.uri stringSpecifies the GCS URI in gcs://<bucket>/<file-path> format. Required when the target type is GCS.NoOnly works in non-interactive mode.
--gcs.service-account-key stringSpecifies the base64 encoded service account key of GCS.NoOnly works in non-interactive mode.
--azblob.uri stringSpecifies the Azure Blob URI in azure://<account>.blob.core.windows.net/<container>/<file-path> format. Required when the target type is AZURE_BLOB.NoOnly works in non-interactive mode.
--azblob.sas-token stringSpecifies the SAS token of Azure Blob.NoOnly works in non-interactive mode.
--csv.delimiter stringSpecifies the delimiter of string type variables in CSV files. (default "\"")NoOnly works in non-interactive mode.
--csv.null-value stringSpecifies the representation of null values in CSV files. (default "\N")NoOnly works in non-interactive mode.
--csv.separator stringSpecifies the separator of each value in CSV files. (default ",")NoOnly works in non-interactive mode.
--csv.skip-headerExports CSV files of the tables without header.NoOnly works in non-interactive mode.
--parquet.compression stringSpecifies the Parquet compression algorithm. One of ["GZIP" "SNAPPY" "ZSTD" "NONE"]. The default value is "ZSTD".NoOnly works in non-interactive mode.
--filter stringsSpecifies the exported tables with table filter patterns. Do not use it with --sql. For more information, see Table Filter.NoOnly works in non-interactive mode.
--sql stringFilters the exported data with the SQL SELECT statement.NoOnly works in non-interactive mode.
--where stringFilters the exported tables with the WHERE condition. Do not use it with --sql.NoOnly works in non-interactive mode.
--compression stringSpecifies the compression algorithm of the export file. The supported algorithms include GZIP, SNAPPY, ZSTD, and NONE. The default value is GZIP.NoOnly works in non-interactive mode.
--forceCreates the export task without confirmation. You need to confirm when you want to export the whole cluster in non-interactive mode.NoOnly works in non-interactive mode.
-h, --helpShows help information for this command.NoWorks in both non-interactive and interactive modes.

Inherited flags

FlagDescriptionRequiredNote
--no-colorDisables color in output.NoOnly works in non-interactive mode. In interactive mode, disabling color might not work with some UI components.
-P, --profile stringSpecifies the active user profile used in this command.NoWorks in both non-interactive and interactive modes.
-D, --debugEnables debug mode.NoWorks in both non-interactive and interactive modes.

Feedback

If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an issue. Also, we welcome any contributions.

Was this page helpful?