Skip to content

build

Create a snapshot of the source database.

clonit build <target> [flags]
Argument Description Required
target Name of the target to snapshot Yes
Flag Type Default Description
--jobs int 0 Number of parallel dump jobs (0 = use target default)
--no-push bool false Skip automatic push to storage after build

Creates a new snapshot of the target’s source database using pg_dump in directory format. The snapshot is stored in the configured working directory (~/.clonit by default).

The --jobs flag controls the number of parallel dump jobs. When set to 0, the target’s configured dump_jobs value is used. If that is also 0, pg_dump uses its own default.

After a successful build, Clonit automatically pushes the snapshot to cloud storage if:

  • The target has a storage profile linked to it
  • The defaults.auto_push config option is true (the default)
  • The --no-push flag is not set

If the target has no storage profile, auto-push is silently skipped. If the push fails, a warning is printed but the command exits successfully – the snapshot is still available locally and can be retried with clonit push.

To disable auto-push globally, set defaults.auto_push: false in the config file or CLONIT_DEFAULTS__AUTO_PUSH=false in the environment.

Build a snapshot using target defaults:

clonit build mydb

Build a snapshot with 8 parallel dump jobs:

clonit build mydb --jobs 8

Build without auto-pushing to storage:

clonit build mydb --no-push

Build with debug output:

clonit --debug build production-snap
  • push – Push a snapshot to remote storage
  • load – Load a snapshot into the destination database
  • snapshots – List snapshots for a target
  • sanitize – Run the sanitization pipeline