weavori sync

Copy data from one PostgreSQL database to another.

Usage

weavori sync [source-dsn] [flags]

The sync command connects to a source PostgreSQL database, introspects its schema, resolves foreign key dependencies, and syncs data table-by-table to a target database. Tables are synced in dependency order to maintain referential integrity.

Flags

FlagDefaultDescription
-o, --output""Target database DSN (required)
--schema""Only sync tables matching this schema name
--table""Only sync tables matching this table name
--mode"copy"Sync mode: copy (fast) or insert (compatible)
--batch1000Number of rows per batch
--create-tablestrueCreate schemas and tables on target before syncing
--no-colorfalseDisable ANSI color output
--verbosefalseInclude detailed progress output

Persistent flags

These flags are inherited from the root command:

FlagDefaultDescription
--api-key""API key for non-interactive authentication
--output"pretty"Output format: pretty, plain, or json

Examples

Full sync

weavori sync "postgres://user:pass@localhost:5432/source" \ --output "postgres://user:pass@localhost:5432/target"

Sync a single schema

weavori sync "postgres://user:pass@localhost:5432/source" \ --output "postgres://user:pass@localhost:5432/target" \ --schema "analytics"

INSERT mode for compatibility

weavori sync "postgres://user:pass@localhost:5432/source" \ --output "postgres://user:pass@localhost:5432/target" \ --mode insert