This command is supported by the Enterprise Edition only.
$ tt [crud] export URI FILE SPACE [EXPORT_OPTION ...]
tt [crud] export exports a space’s data to a file.
crud command is optional and can be used to export a cluster’s data by using the CRUD module. Without
crud, data is exported using the box.space API.
tt [crud] export takes the following arguments:
URI: The URI of a router instance if
crudis used. Otherwise, it should specify the URI of a storage.
FILE: The name of a file for storing exported data.
SPACE: The name of a space from which data is exported.
Read access to the space is required to export its data.
Exporting isn’t supported for the interval field type.
The command below exports data of the
customers space to the
$ tt crud export localhost:3301 customers.csv customers
customers space has five fields (
age), the file with exported data might look like this:
1,477,Andrew,Fuller,38 2,401,Michael,Suyama,46 3,2804,Robert,King,33 # ...
If a tuple contains a
null value, for example,
[1, 477, 'Andrew', null, 38], it is exported as an empty value:
To export data with a space’s field names in the first row, use the
$ tt crud export localhost:3301 customers.csv customers \ --header
In this case, field values start from the second row, for example:
id,bucket_id,firstname,lastname,age 1,477,Andrew,Fuller,38 2,401,Michael,Suyama,46 3,2804,Robert,King,33 # ...
tt exports empty values for fields containing compound data such as arrays or maps.
To export compound values in a specific format, use the
For example, the command below exports compound values serialized in JSON:
$ tt crud export localhost:3301 customers.csv customers \ --compound-value-format json
The maximum number of tuple batches in a queue between a fetch and write threads (the default is
ttexports data using two threads:
- A fetch thread makes requests and receives data from a Tarantool instance.
- A write thread encodes received data and writes it to the output.
The fetch thread uses a queue to pass received tuple batches to the write thread. If a queue is full, the fetch thread waits until the write thread takes a batch from the queue.
The number of tuples to transfer per request (the default is
A format used to export compound values like arrays or maps. By default,
ttexports empty values for fields containing such values.
See also: Exporting compound data.
A password used to connect to the instance.
A username for connecting to the instance.