Skip to main content

sqb clone

Copies model relations from one target to another. Uses zero-copy cloning where the adapter supports it, falling back to physical copies with --hard-copy. No manifest.json generation or artifact management is required. Clone works directly against live targets.

Usage

sqb --project-dir <path> clone --from <target> --to <target> [flags]

Flags

FlagDescription
--fromSource target (required)
--toDestination target (required)
--hard-copyForce physical table copies instead of zero-copy cloning
--no-sql-validationSkip compile-time SQL syntax validation
--select, -sSelect specific models to clone
--excludeExclude specific models from cloning

Examples

# Clone all models from prod to dev
sqb clone --from prod --to dev

# Clone only marts to dev
sqb clone --from prod --to dev --select path:marts

# Force physical copies
sqb clone --from prod --to dev --hard-copy

Clone policies

Targets must allow cloning in sqlbuild_project.toml. See Project Configuration for details.