Bird
0
0

You accidentally ran dbt run --target prod while still testing a new model. What is the best way to fix this mistake?

medium📝 Debug Q7 of 15
dbt - Production Deployment
You accidentally ran dbt run --target prod while still testing a new model. What is the best way to fix this mistake?
ARun <code>dbt clean</code> to undo changes
BRestore the production tables from backup and rerun in dev
CDelete the <code>prod</code> target from profiles.yml
DRun <code>dbt run --target staging</code> to overwrite prod
Step-by-Step Solution
Solution:
  1. Step 1: Understand impact of running in prod

    Running in prod can change live tables.
  2. Step 2: Correct recovery action

    Restoring from backup and rerunning in dev is safest fix.
  3. Final Answer:

    Restore the production tables from backup and rerun in dev -> Option B
  4. Quick Check:

    Fix prod mistake = restore backup B [OK]
Quick Trick: Restore backups if prod is changed by mistake [OK]
Common Mistakes:
MISTAKES
  • Thinking dbt clean undoes data changes
  • Deleting prod target instead of fixing
  • Overwriting prod with staging blindly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes