Rebuild an incremental model while keeping the older version

The problem I’m having

I know we could use the --full-refresh option for dbt run to rebuild the data table from the beginning of time and wipe out all the records from the previous model runs. Is it possible to rebuild from scratch while still keep the previous table records such that I could query both model versions? Thanks!

The context of why I’m trying to do this

We are dealing with an evolving business logic for the data modeling work. Whenever there is a newer version of business logic, we would need to rebuild the data model. We’d like to maintain a stack of different model versions such that we could always revisit older version logic for the purpose of debug and making comparisons of model output.

2 Likes

Right now, this isn’t possible within core dbt constructs but will be soon https://github.com/dbt-labs/dbt-core/discussions/6736

The only way right now is to manually name your models and do it that way.

Note: @Josh Devlin (he) originally posted this reply in Slack. It might not have transferred perfectly.

1 Like