Skip to content

Commit 095a307

Browse files
committed
refactor
1 parent 5a58626 commit 095a307

File tree

1 file changed

+58
-44
lines changed

1 file changed

+58
-44
lines changed

tidb-cloud/serverless-export.md

Lines changed: 58 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,91 +13,105 @@ While you can also export data using `mysqldump`, TiDB Dumpling, or other tools,
1313
- Isolation: the export service uses separate computing resources, ensuring isolation from the resources used by your online services.
1414
- Consistency: the export service ensures the consistency of the exported data without causing locks, which does not affect your online services.
1515

16-
## Export to local
16+
## Features
17+
18+
### Location of files
19+
20+
You can export data to the local storage or an external storage service.
21+
22+
**Local storage**
1723

18-
When you export to local, there are some limitations:
24+
There are some limitations when you export data to local storage:
1925

20-
1. You can only export one table at a time.
26+
1. You are not allowed to export multiple databases at the same time.
2127
2. The exported data will be expired after two days, please download the data in time.
2228
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.
2329

30+
**[Amazon S3](https://aws.amazon.com/s3/)**
31+
32+
You need to provide the credentials of the S3 bucket. Supported credentials include:
33+
34+
- [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.
35+
2436
> **Note:**
2537
>
26-
> We recommend you export to S3 or other supported storage services if you want to export a large amount of data.
38+
> We recommend you export to the external storage service such as S3 when you want to export a large amount of data.
2739
28-
<SimpleTab>
40+
### Data Filtering
2941

30-
<div label="Export With CLI">
42+
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.
3143

32-
1. Export a specific table from a TiDB Serverless cluster to local.
44+
> **Note:**
45+
>
46+
> You must specify the database when you export data to local storage.
3347
34-
```sh
35-
ticloud serverless export create -c <cluster-id> --database <database> --table <table>
36-
```
48+
### Data Formats
3749

38-
2. Download the exported data after the export is succeeded.
50+
You can export data in the following formats:
3951

40-
```sh
41-
ticloud serverless export download -c <cluster-id> -e <export-id>
42-
```
43-
44-
You can also use the cli with interactive mode.
52+
- SQL(default): export data in SQL format.
53+
- CSV: export data in CSV format.
4554

46-
```sh
47-
ticloud serverless export create
48-
```
55+
### Data Compression
4956

50-
</div>
57+
You can compress the exported data in the following algorithms:
5158

52-
<div label="Export On Console">
59+
- gzip(default): compress the exported data with gzip
60+
- snappy: compress the exported data with snappy.
61+
- zstd: compress the exported data with zstd.
62+
- none: do not compress the exported data.
5363

54-
Not supported yet.
64+
### Cancel Export
5565

56-
</div>
66+
You can cancel an export job that is in running state.
5767

58-
</SimpleTab>
68+
## Examples
5969

60-
## Export to S3
70+
Now, you can manage exports with [TiDB Cloud CLI](/tidb-cloud/cli-reference.md).
6171

62-
You can export data directly to your own S3 bucket with the credentials.
72+
### Export to local
6373

64-
<SimpleTab>
74+
First, create an export job which specifies the database and table you want to export. It will output the export ID.
6575

66-
<div label="Export With CLI">
76+
```sh
77+
ticloud serverless export create -c <cluster-id> --database <database> --table <table>
78+
```
6779

68-
1. Export all data from a TiDB Serverless cluster to S3.
80+
Then, download the exported data after the export is succeeded.
6981

7082
```sh
71-
ticloud serverless export create -c <cluster-id> --bucket-uri <bucket-uri> --access-key-id <access-key-id> --secret-access-key <secret-access-key>
83+
ticloud serverless export download -c <cluster-id> -e <export-id>
7284
```
7385

74-
2. Export from a TiDB Serverless cluster to S3 with SQL file.
86+
### Export to S3
7587

7688
```sh
77-
ticloud serverless export create -c <cluster-id> --bucket-uri <bucket-uri> --access-key-id <access-key-id> --secret-access-key <secret-access-key> --file-type SQL
89+
ticloud serverless export create -c <cluster-id> --bucket-uri <bucket-uri> --access-key-id <access-key-id> --secret-access-key <secret-access-key>
7890
```
7991

80-
You can also use the cli with interactive mode.
92+
### Export with CSV format
8193

8294
```sh
83-
ticloud serverless export create
95+
ticloud serverless export create -c <cluster-id> --file-type CSV
8496
```
8597

86-
</div>
87-
88-
<div label="Export On Console">
98+
### Export the whole database
8999

90-
Not supported yet.
100+
```sh
101+
ticloud serverless export create -c <cluster-id> --database <database>
102+
```
91103

92-
</div>
104+
### Export with snappy compression.
93105

94-
</SimpleTab>
106+
```sh
107+
ticloud serverless export create -c <cluster-id> --compress snappy
108+
```
95109

96-
## Features
110+
### Cancel an export job
97111

98-
- 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.
99-
- Support exporting a specific database or table.
100-
- Support exporting as CSV or SQL format.
112+
```sh
113+
ticloud serverless export cancel -c <cluster-id> -e <export-id>
114+
```
101115

102116
## Pricing
103117

0 commit comments

Comments
 (0)