clone command helps you create a copy of your Xata database or clone an external PostgreSQL database into Xata. It supports data anonymization and advanced configuration for complex migration scenarios.
Subcommands
start
Start performs a snapshot of the configured source Postgres database into the configured target.string
The source URL of the database to clone
string
.env or .yaml config file to use with pgstream if any
string
Log level for the application. One of trace, debug, info, warn, error, fatal, panic
string
File where the pg_dump output will be written
string
Source postgres database to perform the snapshot from
boolean
Whether to produce CPU and memory profile files, as well as exposing a /debug/pprof endpoint on localhost:6060
boolean
Whether to reset the target before snapshotting (only for postgres target)
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
Organization ID (default: "")
string
Project ID (default: "")
string
Branch ID (default: "")
string
Tables to filter (default: .)
string
Anonymization validation mode, strict implies that all tables and columns should be specified (strict|relaxed|prompt, default: prompt)
string
Postgres role to use for the clone
boolean
Print help information and exit
config
Automatically configure the transformations for the clone command.string
The source URL of the database to clone
string
The assisting mode to help with the configuration generation (auto|prompt|web|ai, default: prompt)
string
Anonymization validation mode, strict implies that all tables and columns should be specified (strict|relaxed|prompt, default: prompt)
string
Organization ID (default: "")
string
Project ID (default: "")
string
Branch ID (default: "")
boolean
Print help information and exit
stream
Start a continuous data stream from the configured source to the configured target using Postgres’s logical replication.string
required
The source URL of the database to stream from
string
.env or .yaml config file to use with pgstream if any
string
Log level for pgstream (trace|debug|info|warn|error|fatal|panic, default: info)
boolean
Whether to initialize pgstream before starting replication
boolean
Whether to expose a /debug/pprof endpoint on localhost:6060
string
Name of the postgres replication slot for pgstream to connect to
boolean
Whether to reset the target before snapshotting (only for postgres target)
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
Target type. One of postgres, opensearch, elasticsearch, kafka
string
Target URL
string
Organization ID
string
Project ID
string
Branch ID
string
Tables to filter (default: .)
string
Anonymization validation mode, strict implies that all tables and columns should be specified (strict|relaxed|prompt, default: prompt)
string
Postgres role to use for streaming (it should have atleast REPLICATION privilege)
boolean
Copy roles, owners, and privileges to the target (default: false)
boolean
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 (default: false)
boolean
Print help information and exit
Global Flags
boolean
Print help information and exit
boolean
Output in JSON format