Getting started
CloneDB is a single static binary. PostgreSQL is supported today (MySQL is planned behind the same driver interface).
Requires PostgreSQL 12 or newer on the source: CloneDB models declarative partitioning via
pg_partition_treeand has no older-server fallback.
Install
Section titled “Install”Install with Homebrew:
brew install clonedb/tap/clonedbQuickstart
Section titled “Quickstart”1. Generate a config
Section titled “1. Generate a config”init is an interactive wizard — it connects, then walks you through choosing schemas, tables, and
filters, and writes a clonedb.toml:
clonedb initPicked the wrong thing? Choose ← Back (the first entry on each list prompt) to return to the
previous question and revise it without losing earlier answers, or press Esc to cancel. See
the CLI reference for the full navigation rules.
Prefer non-interactive (CI, scripting)? Use generate-config:
clonedb generate-config --schemas public --source "$SOURCE_DATABASE_URL"2. Preview the plan
Section titled “2. Preview the plan”See what a run would pull — per-table estimated row counts — before moving any data:
clonedb run --dry-runThese are fast planner estimates (rendered ~N) — --dry-run never scans rows. Each
table shows a scoped count (trimmed to your seed closure) or a whole count (pulled
entire because nothing connects it to a seed yet). A big whole count means wire that
table up — add a virtual FK or a restriction. Treat the plan as a scope check, not an exact
size — see the CLI reference for details.
3. Pull the subset
Section titled “3. Pull the subset”Into a live dev database (idempotent upsert):
clonedb run --target "$DEV_DATABASE_URL"…or to a portable SQL file:
clonedb run --output-sql subset.sql4. Keep the config current
Section titled “4. Keep the config current”After a migration adds tables, reconcile the config without losing your edits. By
default sync-config only previews the diff — pass --write to apply it:
clonedb sync-config # preview the changesclonedb sync-config --write # apply them, preserving your edits and commentsNext steps
Section titled “Next steps”- CLI reference — every command and flag.
- Configuration — the full config reference.
- vs. other tools — how CloneDB compares to Greenmask, Neosync, and friends.