start or continuously with stream, and can anonymize columns on the way in. config writes the anonymization rules the other two read.
Every command below also takes -h, --help.
xata clone start— Snapshot a PostgreSQL database into a Xata branchxata clone config— Write the anonymization rules that clone start and stream applyxata clone stream— Stream a PostgreSQL database into a Xata branch continuously
start
Snapshot a PostgreSQL database into a Xata branch Copies the source database into the branch once. The anonymization rules in.xata/clone.yaml are applied on the way in, and strict validation refuses to run until every table and column is covered by them.
string
.env or .yaml config file to use with pgstream if any
string
Log output format. One of console, json
trace | debug | info | warn | error | fatal | panic
default:"info"
Log level for pgstream
string
Disable ANSI color codes in console log output (ignored when —log-format=json)
string
File where the pg_dump output will be written
string
Source postgres database to perform the snapshot from
string
Whether to produce CPU and memory profile files, as well as exposing a /debug/pprof endpoint on localhost:6060
string
Whether to reset the target before snapshotting (only for postgres target). Destructive: drops the target objects before the data is copied, so a failed snapshot leaves the target without its previous contents
string
List of tables to snapshot, in the format
<schema>.<table>. If not specified, the schema public will be assumed. Wildcards are supportedstring
Target type. One of postgres, opensearch, elasticsearch, kafka
string
Target URL
string
required
The source URL of the database to clone
string
Organization ID
string
Project ID
string
Branch ID
string
Target database name on the checked-out Xata branch
string
default:"*.*"
Tables to filter
strict | relaxed | prompt
default:"prompt"
Anonymization validation mode, strict implies that all tables and columns should be specified
string
Postgres role to use for the clone
boolean
default:"false"
Copy roles, owners, and privileges to the target
boolean
default:"false"
Temporarily tune the target branch for bulk loading, reverting the change when the clone stops. Raises max_wal_size on the branch and the maintenance settings on the index rebuild.
config
Write the anonymization rules that clone start and stream apply Inspects the source database and writes.xata/clone.yaml, interactively or with AI, so the columns that carry personal data are transformed as they are copied.
string
required
The source URL of the database to clone
auto | prompt | web | ai
default:"prompt"
The assisting mode to help with the configuration generation
strict | relaxed | prompt
default:"prompt"
Anonymization validation mode, strict implies that all tables and columns should be specified
string
Organization ID
string
Project ID
string
Branch ID
string
Instructions for AI mode (e.g., which columns to anonymize, specific transformers to use)
string
Anthropic model override for AI mode
string
The profile to use
stream
Stream a PostgreSQL database into a Xata branch continuously Follows the source through logical replication, so the branch keeps up with it until the command is stopped. Passing--snapshot-tables copies those tables first, otherwise only the changes from now on are streamed.
string
.env or .yaml config file to use with pgstream if any
string
Log output format. One of console, json
trace | debug | info | warn | error | fatal | panic
default:"info"
Log level for pgstream
string
Disable ANSI color codes in console log output (ignored when —log-format=json)
string
When used with —snapshot-tables, skip schema restore and only snapshot data (use when schema is already present on target)
string
File where the pg_dump output will be written if initial snapshot is enabled
string
Whether to initialize pgstream before starting replication
string
Whether to expose a /debug/pprof endpoint on localhost:6060
string
Name of the replication slot on the source database. Overrides the default slot name
string
Whether to reset the target before snapshotting (only for postgres target). Destructive: drops the target objects before the data is copied, so a failed snapshot leaves the target without its previous contents
string
List of tables to snapshot if initial snapshot is required, in the format
<schema>.<table>. If not specified, the schema public will be assumed. Wildcards are supportedstring
Source type. One of postgres, kafka
string
required
The source URL of the database to stream from
string
Target type. One of postgres, opensearch, elasticsearch, kafka
string
Target URL
string
Clean up v0.9.x state before initializing (idempotent, safe for repeated use; implies —init)
string
Whether to enable the injection of pgstream metadata to the WAL events. Required for search targets.
string
Organization ID
string
Project ID
string
Branch ID
string
Target database name on the checked-out Xata branch
string
default:"*.*"
Tables to filter
strict | relaxed | prompt
default:"prompt"
Anonymization validation mode, strict implies that all tables and columns should be specified
string
Postgres role to use for streaming (it should have at least REPLICATION privilege)
boolean
default:"false"
Copy roles, owners, and privileges to the target
boolean
default:"false"
Skip DDL tracking during streaming. Useful for managed PostgreSQL services that do not support superuser access required for event triggers. Requires —replication-slot flag to be set with a pre-created replication slot on the source database.