weavori sync

Copy data from one PostgreSQL database to another.

Last updated October 20, 2018

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
--target""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)
--batch5000Number of rows per batch
--create-tablestrueCreate schemas and tables on target before syncing

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
-v, --verbosefalseEnable debug output

Examples

Full sync

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

Sync a single schema

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

INSERT mode for compatibility

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