diff --git a/tidb-cloud/serverless-export.md b/tidb-cloud/serverless-export.md index b015054f59f30..20aba65b547fb 100644 --- a/tidb-cloud/serverless-export.md +++ b/tidb-cloud/serverless-export.md @@ -13,91 +13,105 @@ While you can also export data using `mysqldump`, TiDB Dumpling, or other tools, - Isolation: the export service uses separate computing resources, ensuring isolation from the resources used by your online services. - Consistency: the export service ensures the consistency of the exported data without causing locks, which does not affect your online services. -## Export to local +## Features + +### Location of files + +You can export data to the local storage or an external storage service. + +**Local storage** -When you export to local, there are some limitations: +There are some limitations when you export data to local storage: -1. You can only export one table at a time. +1. You are not allowed to export multiple databases at the same time. 2. The exported data will be expired after two days, please download the data in time. 3. The exported data will be saved in the stashing area, which offers 250 GB storage space for each organization per region. If the storage space is full, you will not be able to export data to local. +**[Amazon S3](https://aws.amazon.com/s3/)** + +You need to provide the credentials of the S3 bucket. Supported credentials include: + +- [Access Key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html): The long-term credentials for an IAM user or the AWS account root user. Please make sure the access key has the necessary permissions to your S3 bucket, we recommend you create a new bucket with full s3 access. + > **Note:** > -> We recommend you export to S3 or other supported storage services if you want to export a large amount of data. +> We recommend you export to the external storage service such as S3 when you want to export a large amount of data. - +### Data Filtering -
+You can filter data by specifying the database and table you want to export. If you do not specify the table, we will export all tables in the specified database. If you do not specify the database, we will export all databases in the cluster. -1. Export a specific table from a TiDB Serverless cluster to local. +> **Note:** +> +> You must specify the database when you export data to local storage. - ```sh - ticloud serverless export create -c --database --table - ``` +### Data Formats -2. Download the exported data after the export is succeeded. +You can export data in the following formats: - ```sh - ticloud serverless export download -c -e - ``` - -You can also use the cli with interactive mode. +- SQL(default): export data in SQL format. +- CSV: export data in CSV format. - ```sh - ticloud serverless export create - ``` +### Data Compression - +You can compress the exported data in the following algorithms: -
+- gzip(default): compress the exported data with gzip +- snappy: compress the exported data with snappy. +- zstd: compress the exported data with zstd. +- none: do not compress the exported data. -Not supported yet. +### Cancel Export -
+You can cancel an export job that is in running state. - +## Examples -## Export to S3 +Now, you can manage exports with [TiDB Cloud CLI](/tidb-cloud/cli-reference.md). -You can export data directly to your own S3 bucket with the credentials. +### Export to local - +First, create an export job which specifies the database and table you want to export. It will output the export ID. -
+ ```sh + ticloud serverless export create -c --database --table
+ ``` -1. Export all data from a TiDB Serverless cluster to S3. +Then, download the exported data after the export is succeeded. ```sh - ticloud serverless export create -c --bucket-uri --access-key-id --secret-access-key + ticloud serverless export download -c -e ``` -2. Export from a TiDB Serverless cluster to S3 with SQL file. +### Export to S3 ```sh - ticloud serverless export create -c --bucket-uri --access-key-id --secret-access-key --file-type SQL + ticloud serverless export create -c --bucket-uri --access-key-id --secret-access-key ``` -You can also use the cli with interactive mode. +### Export with CSV format ```sh - ticloud serverless export create + ticloud serverless export create -c --file-type CSV ``` - - -
+### Export the whole database -Not supported yet. + ```sh + ticloud serverless export create -c --database + ``` -
+### Export with snappy compression. - + ```sh + ticloud serverless export create -c --compress snappy + ``` -## Features +### Cancel an export job -- Support exporting data to local and [Amazon S3](https://aws.amazon.com/s3/). Please Contact [TiDB Cloud Support](/tidb-cloud/tidb-cloud-support.md) if your want to export to other storage services. -- Support exporting a specific database or table. -- Support exporting as CSV or SQL format. + ```sh + ticloud serverless export cancel -c -e + ``` ## Pricing