Cloning objects between environments with dbt clone
The dbt clone command creates lightweight clones of upstream models into your current target schema, using database-native cloning (e.g., zero-copy clone) where supported, or view-based fallback otherwise. It is primarily used to speed up CI/CD workflows and development by avoiding full rebuilds of unchanged models, cloning them from a stateful state (like the prod manifest) instead. This is closely tied to dbt's state-based selection (--state) and deferral features.
1 · Learn the must-know
dbt clonerequires a--stateflag pointing to a manifest.json from a previous run, typically production, to know what to clone.- It works hand-in-hand with
state:modifiedselection, allowing unchanged models to be cloned instead of rebuilt, saving compute and time in CI jobs. - On platforms that support zero-copy cloning (e.g., Snowflake, Databricks), clones are fast, storage-efficient, and use native
CREATE ... CLONEorCREATE TABLE ... LIKEmechanics; other adapters fall back to creating views pointing to the original relation. - Cloned relations are created in the current target schema/database as defined by your target, not in the original schema, enabling isolated environments like CI schemas.
dbt cloneis distinct from--defer: deferral only resolves refs to unbuilt upstream nodes at compile time without creating anything, whereas clone actually materializes a cloned relation in your target.- Common gotcha: cloning does not re-run tests or freshness checks on the cloned model, so you must still validate that the source state is trustworthy (e.g., a recent successful prod run).
2 · Check your understanding
A team wants to speed up CI builds by reusing production data for any model that hasn't changed, while still fully building any model that has changed. Which command accomplishes this using dbt clone?
What you have tried across dbt Analytics Engineering's objectives, not a readiness score.
Developing and optimizing dbt models45.16% of the exam*0 of 14 tried
Managing dbt models governance9.68% of the exam*0 of 3 tried
Debugging data modeling errors16.13% of the exam*0 of 5 tried
Troubleshooting and optimizing dbt pipelines6.45% of the exam*0 of 2 tried
Implementing dbt tests9.68% of the exam*0 of 3 tried
Implementing and maintaining external dependencies6.45% of the exam*0 of 2 tried
Leveraging the dbt state6.45% of the exam*0 of 2 tried
* Our estimate. dbt Labs publishes no section weights.
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.