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.The source URL of the database to clone
.env or .yaml config file to use with pgstream if any
Log level for the application. One of trace, debug, info, warn, error, fatal, panic
File where the pg_dump output will be written
Source postgres database to perform the snapshot from
Whether to produce CPU and memory profile files, as well as exposing a /debug/pprof endpoint on localhost:6060
Whether to reset the target before snapshotting (only for postgres target)
List of tables to snapshot, in the format
<schema>.<table>
. If not specified, the schema public
will be assumed. Wildcards are supportedTarget type. One of postgres, opensearch, elasticsearch, kafka
Target URL
Organization ID (default: "")
Project ID (default: "")
Branch ID (default: "")
Tables to filter (default: .)
Anonymization validation mode, strict implies that all tables and columns should be specified (strict|relaxed|prompt, default: prompt)
Postgres role to use for the clone
Print help information and exit
config
Automatically configure the transformations for the clone command.The source URL of the database to clone
The assisting mode to help with the configuration generation (auto|prompt|web|ai, default: prompt)
Anonymization validation mode, strict implies that all tables and columns should be specified (strict|relaxed|prompt, default: prompt)
Organization ID (default: "")
Project ID (default: "")
Branch ID (default: "")
Print help information and exit
stream
Start a continuous data stream from the configured source to the configured target using Postgres’s logical replication.The source URL of the database to stream from
.env or .yaml config file to use with pgstream if any
Log level for pgstream (trace|debug|info|warn|error|fatal|panic, default: info)
Whether to initialize pgstream before starting replication
Whether to expose a /debug/pprof endpoint on localhost:6060
Name of the postgres replication slot for pgstream to connect to
Whether to reset the target before snapshotting (only for postgres target)
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 supportedSource type. One of postgres, kafka
Target type. One of postgres, opensearch, elasticsearch, kafka
Target URL
Organization ID
Project ID
Branch ID
Tables to filter (default: .)
Anonymization validation mode, strict implies that all tables and columns should be specified (strict|relaxed|prompt, default: prompt)
Postgres role to use for streaming (it should have atleast REPLICATION privilege)
Print help information and exit
Global Flags
Print help information and exit
Output in JSON format