weavori sync
Copy data from one PostgreSQL database to another.
Last updated August 14, 2026
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
| Flag | Default | Description |
|---|---|---|
--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) |
--batch | 5000 | Number of rows per batch |
--create-tables | true | Create schemas and tables on target before syncing |
--subset | "" | Copy only a slice of each table: N rows or N% (e.g. --subset 1000 or --subset 10%). Referenced parents are pulled in so the slice stays referentially intact |
--anonymize | false | Scrub PII columns deterministically (the same original always maps to the same fake). *_id, serial, numeric, and boolean columns are never scrubbed, so foreign keys survive |
--seed | 0 | Reproducible anonymization: the same seed over the same rows produces the same fakes. 0 is random |
Persistent flags
These flags are inherited from the root command:
| Flag | Default | Description |
|---|---|---|
--api-key | "" | API key for non-interactive authentication |
--output | "pretty" | Output format: pretty, plain, or json |
-v, --verbose | false | Enable 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
Subset with PII scrubbed
Copy a referentially complete slice and scrub PII in one pass. The --seed makes the scrub maps reproducible, so re-running produces the same fakes.
$weavori sync "postgres://user:pass@localhost:5432/source" \
--target "postgres://user:pass@localhost:5432/staging" \
--subset 10% --anonymize --seed 42