# Running clones in CI when prod is a different snowflake database

**URL:** <https://discourse.getdbt.com/t/running-clones-in-ci-when-prod-is-a-different-snowflake-database/11695>\
**Category:** Help\
**Tags:** ci-cd, clone, snowflake, deferral-and-state\
**Created:** [January 18, 2024, 7:57am UTC](https://discourse.getdbt.com/t/running-clones-in-ci-when-prod-is-a-different-snowflake-database/11695 "2024-01-18T07:57:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigveks94](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sigveks94](https://discourse.getdbt.com/u/sigveks94)\
**Post date:** [January 18, 2024, 7:57am UTC](https://discourse.getdbt.com/t/running-clones-in-ci-when-prod-is-a-different-snowflake-database/11695/1 "2024-01-18T07:57:42Z")

</div>

Hi @joellabes ! Hope this thread is still alive. In our current slim ci setup we have a dedicated Snowflake Database where all these dbt\_cloud\_pr schemas are written. Is there a way to get the upstream references of the state:modified models to read from our Production database and custom schemas from there and build the state:modified+ models into the default schema (dbt\_cloud\_pr\_xx…)? Currently the clone combined with defer is able to clone tables from the defered production environment and materialize into the default schema in our CI database properly, but the build command does not then refer upstream models to either our default schema upstream (in CI database) or to the production database. I would like to not have to clone the entire Production database into our CI database as a prior step to Slim CI.

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [January 22, 2024, 7:26pm UTC](https://discourse.getdbt.com/t/running-clones-in-ci-when-prod-is-a-different-snowflake-database/11695/2 "2024-01-22T19:26:12Z")

</div>

> [@sigveks94](#):
>
> Currently the clone combined with defer is able to clone tables from the defered production environment and materialize into the default schema in our CI database properly

Are you using the `dbt clone` command, or triggering a zero-copy-clone manually?

> [@sigveks94](#):
>
> but the build command does not then refer upstream models to either our default schema upstream (in CI database) or to the production database.

where does it defer to instead?

Can you post the full steps + config in your CI job?
