Database to dbt Migration Workflow
Purpose and When to Use
Guide AI agents through the complete migration lifecycle from Snowflake or legacy database systems
(SQL Server, Oracle, Teradata, etc.) to production-quality dbt projects on Snowflake. This skill
defines a structured, repeatable process while delegating platform-specific syntax translation to
dedicated source-specific skills.
Activate this skill when users ask about:
- Planning a database migration to dbt
- Organizing legacy scripts for migration
- Converting views and stored procedures to dbt models
- Testing migration results against source systems
- Deploying migrated dbt projects to production
Snowflake Migration Tools
Recommended Two-Step Approach
- Convert to Snowflake first: Use SnowConvert AI and AI Powered Code Conversion to convert
source database objects (from SQL Server, Oracle, Teradata, etc.) to Snowflake tables, views, and
stored procedures.
- Then convert to dbt: Use the $dbt-migration-snowflake skill to migrate Snowflake objects to
dbt models.
SnowConvert AI (Recommended for Supported Platforms)
SnowConvert AI converts
source DDL, views, stored procedures, functions, and additional objects (triggers, sequences,
indexes) to Snowflake-compatible SQL.
Download SnowConvert AI
Supported Platforms
- Full support (tables, views, procedures, functions): SQL Server, Oracle, Teradata, Redshift,
Azure Synapse, IBM DB2
- Partial support (tables, views only): Sybase IQ, BigQuery, PostgreSQL, Spark SQL/Databricks,
Hive, Vertica, Greenplum/Netezza
Platform-Specific Features
- SQL Server: Direct DB connection, data migration, SSIS replatform
- Oracle, Azure Synapse, Sybase IQ, BigQuery: DDL Extraction script
- Teradata: BTEQ/MLOAD/TPUMP support
- Redshift: Direct DB connection, data migration
Additional Snowflake Migration Tools
| Tool |
Purpose |
| AI Code Conversion |
AI-powered validation and repair of converted code |
| Migration Assistant |
VS Code extension for resolving conversion issues (EWIs) |
| Data Migration |
Transfer data to Snowflake (SQL Server, Redshift) |
| Data Validation |
GUI-based validation (SQL Server) |
| Data Validation CLI |
CLI validation (SQL Server, Teradata, Redshift) |
| ETL Replatform |
Convert SSIS packages to dbt projects |
| Power BI Repointing |
Redirect Power BI reports to Snowflake |
Migration Workflow Overview
The migration process follows seven sequential phases. Each phase has entry criteria, deliverables,
and validation gates that must pass before advancing.
1-Discovery → 2-Planning → 3-Placeholders → 4-Views → 5-Table Logic → 6-Testing → 7-Deployment
Phase 1: Discovery and Assessment
Create a complete inventory of source database objects and understand dependencies, volumes, and
complexity to inform migration planning.
SnowConvert AI Option: If your platform is supported, SnowConvert AI provides extraction scripts
that automate object inventory, dependency mapping, and initial code conversion.
Phase 1 Activities
- Inventory source objects: Query system catalogs for tables, views, procedures, functions
- Document dependencies: Map object dependencies to determine migration order
- Document volumes: Record row counts and data sizes
- Assess complexity: Categorize objects as Low/Medium/High/Custom complexity
- Create migration tracker: Document objects in spreadsheet or issue tracker
Complexity Assessment
| Complexity |
Criteria |
Examples |
| Low |
Simple SELECT, no/minimal joins |
Lookup tables, simple views |
| Medium |
Multiple joins, aggregations, CASE |
Summary views, report queries |
| High |
Procedural logic, cursors, temp tables |
SCD procedures, bulk loads |
| Custom |
Platform-specific features |
Wrapped code, CLR functions |
Phase 1 Checklist
Phase 2: Planning and Organization
Organize legacy scripts, map objects to the dbt medallion architecture, and establish naming
conventions before any conversion begins.
Phase 2 Activities
- Organize legacy scripts: Create folder structure (tables/, views/, stored_procedures/,
functions/)
- Map to medallion layers: Assign objects to Bronze/Silver/Gold with appropriate prefixes
- Define naming conventions: Follow $dbt-architecture skill patterns
- Create dependency graph: Visualize migration order
- Establish validation criteria: Define success metrics per object
Layer Mapping Reference
| Source Object Type |
Target Layer |
dbt Prefix |
Materialization |
| Source tables (raw) |
Bronze |
stg_ |
ephemeral |
| Simple views |
Bronze |
stg_ |
ephemeral |
| Complex views |
Silver |
int_ |
ephemeral/table |
| Dimension procedures |
Gold |
dim_ |
table |
| Fact procedures |
Gold |
fct_ |
incremental |
Phase 2 Checklist
Phase 3: Create Placeholder Models
Create empty dbt models with correct column names, data types, and schema documentation before
adding any transformation logic. This establishes the contract for downstream consumers.
Phase 3 Activities
- Generate placeholder models: Create SQL files with
null::datatype as column_name pattern
and where false
- Map datatypes: Use platform-specific skill for datatype conversion to Snowflake types
- Create schema documentation: Generate
_models.yml with column descriptions and tests
- Validate compilation: Run
dbt compile --select tag:placeholder
- Track status: Add
placeholder tag to config for tracking
Placeholder Model Pattern
{{ config(materialized='ephemeral', tags=['placeholder', 'bronze']) }}
select
null::integer as column_id,
null::varchar(100) as column_name,
-- ... additional columns with explicit types
where false
Phase 3 Checklist
Phase 4: Convert Views
Convert source database views to dbt models, starting with simple views before tackling complex
ones. Views are typically easier than stored procedures as they contain declarative SQL.
Phase 4 Activities
- Prioritize by complexity: Simple views (no joins) → Join views → Aggregate views → Complex
views
- Apply syntax translation: Delegate to platform-specific skill (see Related Skills)
- Structure with CTEs: Use standard CTE pattern from $dbt-modeling skill
- Add tests: Define tests in
_models.yml using $dbt-testing skill patterns
- Replace placeholder logic: Update placeholder SELECT with converted logic
Phase 4 Checklist
Phase 5: Convert Table Logic from Stored Procedures
Transform procedural stored procedure logic into declarative dbt models, selecting appropriate
materializations for different ETL patterns.
Phase 5 Activities
- Analyze ETL patterns: Identify Full Refresh, SCD Type 1/2, Append, Delete+Insert patterns
- Map to materializations: Use pattern-to-materialization mapping from $dbt-materializations
skill
- Break complex procedures: Split single procedures into multiple intermediate/final models
- Convert procedural constructs: Replace cursors, temp tables, variables with declarative SQL
- Document decisions: Add header comments explaining conversion approach
Pattern Mapping Reference
| Source Pattern |
dbt Approach |
| TRUNCATE + INSERT |
materialized='table' |
| UPDATE + INSERT (SCD1) |
materialized='incremental' with merge |
| SCD Type 2 |
dbt snapshot or custom incremental |
| INSERT only |
materialized='incremental' append |
| DELETE range + INSERT |
incremental with delete+insert strategy |
Procedural to Declarative Conversion
| Procedural Pattern |
dbt Equivalent |
| CURSOR loop |
Window function or recursive CTE |
| Temp tables |
CTEs or intermediate models |
| Variables |
Jinja variables or macros |
| IF/ELSE branches |
CASE expressions or {% if %} |
| TRY/CATCH |
Pre-validation tests |
Phase 5 Checklist
Phase 6: End-to-End Testing and Validation
Verify that migrated dbt models produce identical results to source system, using multiple
validation techniques to ensure data integrity.
Snowflake Data Validation CLI: For SQL Server, Teradata, or Redshift migrations, the
Data Validation CLI
provides automated schema validation (columns, data types, row counts) and metrics validation (MIN,
MAX, AVG, NULL count, DISTINCT count).
Phase 6 Activities
- Row count validation: Compare total counts between source and target
- Column checksum validation: Compare row-level hashes to identify differences
- Business rule validation: Verify calculated fields match source logic
- Aggregate validation: Compare summary metrics (sums, counts, averages)
- Mock data testing: Create seed fixtures for complex transformation testing
- Incremental validation: Test both full-refresh and incremental runs
- Document results: Create validation report for each migrated object
Validation Techniques
| Technique |
Purpose |
Implementation |
| Row counts |
Detect missing/extra rows |
Compare COUNT(*) |
| Checksums |
Detect value differences |
SHA2 hash comparison |
| Business rules |
Verify logic accuracy |
Singular tests |
| Aggregates |
Validate totals |
SUM/AVG comparisons |
| Mock data |
Test transformations |
Seed files + expected outputs |
Phase 6 Checklist
Phase 7: Deployment and Cutover
Deploy validated dbt models to production with a clear cutover plan and monitoring strategy.
Phase 7 Activities
- Deploy to Development: Run
dbt build --target dev and validate
- Deploy to Test/UAT: Run full validation suite with
--store-failures
- Create cutover plan: Document pre-cutover, cutover, post-cutover, and rollback steps
- Deploy to Production: Execute deployment with production data
- Configure scheduled runs: Set up Snowflake tasks or dbt Cloud scheduling
- Monitor post-deployment: Track run duration, row counts, test failures, performance
Cutover Plan Template
| Phase |
Activities |
| Pre-Cutover (T-1) |
Final validation, stakeholder sign-off, rollback docs, user communication |
| Cutover (T-0) |
Disable source ETL, final sync, deploy, build, validate, update BI connections |
| Post-Cutover (T+1) |
Monitor performance, verify schedules, confirm access, close tickets |
| Rollback |
Re-enable source ETL, revert BI connections, document issues |
Phase 7 Checklist
Related Skills
Platform-Specific Translation Skills
For syntax translation, delegate to the appropriate source-specific skill:
| Source Platform |
Skill |
Key Considerations |
| Snowflake |
$dbt-migration-snowflake |
Convert Snowflake objects to dbt |
| SQL Server / Azure Synapse |
$dbt-migration-ms-sql-server |
T-SQL, IDENTITY, TOP, #temp tables |
| Oracle |
$dbt-migration-oracle |
PL/SQL, ROWNUM, CONNECT BY, packages |
| Teradata |
$dbt-migration-teradata |
QUALIFY, BTEQ, volatile tables |
| BigQuery |
$dbt-migration-bigquery |
UNNEST, STRUCT/ARRAY, backticks |
| Redshift |
$dbt-migration-redshift |
DISTKEY/SORTKEY, COPY/UNLOAD |
| PostgreSQL / Greenplum / Netezza |
$dbt-migration-postgres |
Array expressions, psql commands |
| IBM DB2 |
$dbt-migration-db2 |
SQL PL, FETCH FIRST, handlers |
| Hive / Spark / Databricks |
$dbt-migration-hive |
External tables, PARTITIONED BY |
| Vertica |
$dbt-migration-vertica |
Projections, flex tables |
| Sybase IQ |
$dbt-migration-sybase |
T-SQL variant, SELECT differences |
Quick Reference: Phase Summary
| Phase |
Key Deliverable |
Exit Criteria |
Primary Skill |
Validation Focus |
Validation Command |
| 1. Discovery |
migration_inventory.csv, dependency graph |
Inventory complete, dependencies mapped |
This skill |
Object counts, dependency completeness |
Manual review |
| 2. Planning |
Folder structure, _naming_conventions.md |
Folder structure created, naming defined |
$dbt-architecture |
Folder hierarchy, naming conventions |
ls -la models/ |
| 3. Placeholders |
.sql files, _models.yml |
All models compile with where false |
This skill |
YAML structure, column definitions, naming |
dbt compile --select tag:placeholder |
| 4. Views |
Converted view models |
All views converted and compile |
dbt-migration-{source}, $dbt-modeling |
Syntax translation, CTE patterns, ref() usage |
dbt build --select tag:view |
| 5. Table Logic |
Converted procedure models |
All procedures converted |
$dbt-materializations |
Incremental configs, materialization patterns |
dbt build --select tag:procedure |
| 6. Testing |
Validation queries, test results |
All validation queries pass |
$dbt-testing, $dbt-performance |
Test coverage, constraint definitions |
dbt test --store-failures |
| 7. Deployment |
Production models, monitoring |
Production deployment successful |
$dbt-commands, $snowflake-cli |
Run success, schedule configuration |
dbt build --target prod |
General Skills
- $dbt-core: Local installation, configuration, package management
- $snowflake-connections: Connection setup for Snowflake CLI, Streamlit, dbt
Validation Requirements
CRITICAL: Agents must not advance to the next phase until all validations pass.
Before proceeding to each phase, verify:
dbt compile succeeds
dbt test passes
- Validation hooks report no errors
Hook configuration is defined in .claude/settings.local.json.
1---2name: dbt-migration3description: Complete workflow for migrating database tables, views, and stored procedures to dbt projects on Snowflake. Orchestrates discovery, planning, placeholder creation, view/procedure conversion, testing, and deployment. Delegates platform-specific syntax translation to source-specific skills.4---5
6# Database to dbt Migration Workflow
7
8## Purpose and When to Use
9
10Guide AI agents through the complete migration lifecycle from Snowflake or legacy database systems
11(SQL Server, Oracle, Teradata, etc.) to production-quality dbt projects on Snowflake. This skill
12defines a structured, repeatable process while delegating platform-specific syntax translation to
13dedicated source-specific skills.
14
15Activate this skill when users ask about:
16
17- Planning a database migration to dbt
18- Organizing legacy scripts for migration
19- Converting views and stored procedures to dbt models
20- Testing migration results against source systems
21- Deploying migrated dbt projects to production
22
23---
24
25## Snowflake Migration Tools
26
27### Recommended Two-Step Approach
28
291. **Convert to Snowflake first**: Use SnowConvert AI and AI Powered Code Conversion to convert
30 source database objects (from SQL Server, Oracle, Teradata, etc.) to Snowflake tables, views, and
31 stored procedures.
322. **Then convert to dbt**: Use the $dbt-migration-snowflake skill to migrate Snowflake objects to
33 dbt models.
34
35### SnowConvert AI (Recommended for Supported Platforms)
36
37[SnowConvert AI](https://docs.snowflake.com/en/migrations/snowconvert-docs/general/about) converts
38source DDL, views, stored procedures, functions, and additional objects (triggers, sequences,
39indexes) to Snowflake-compatible SQL.
40[Download SnowConvert AI](https://docs.snowflake.com/en/migrations/snowconvert-docs/general/getting-started/download-and-access)
41
42#### Supported Platforms
43
44- **Full support** (tables, views, procedures, functions): SQL Server, Oracle, Teradata, Redshift,
45 Azure Synapse, IBM DB2
46- **Partial support** (tables, views only): Sybase IQ, BigQuery, PostgreSQL, Spark SQL/Databricks,
47 Hive, Vertica, Greenplum/Netezza
48
49#### Platform-Specific Features
50
51- SQL Server: Direct DB connection, data migration, SSIS replatform
52- Oracle, Azure Synapse, Sybase IQ, BigQuery: DDL Extraction script
53- Teradata: BTEQ/MLOAD/TPUMP support
54- Redshift: Direct DB connection, data migration
55
56### Additional Snowflake Migration Tools
57
58| Tool | Purpose |
59| ------------------------------------------------------- | -------------------------------------------------------- |
60| [AI Code Conversion](resources/ai-code-conversion.md) | AI-powered validation and repair of converted code |
61| [Migration Assistant](resources/migration-assistant.md) | VS Code extension for resolving conversion issues (EWIs) |
62| [Data Migration](resources/data-migration.md) | Transfer data to Snowflake (SQL Server, Redshift) |
63| [Data Validation](resources/data-validation.md) | GUI-based validation (SQL Server) |
64| [Data Validation CLI](resources/data-validation-cli.md) | CLI validation (SQL Server, Teradata, Redshift) |
65| [ETL Replatform](resources/etl-replatform.md) | Convert SSIS packages to dbt projects |
66| [Power BI Repointing](resources/power-bi-repointing.md) | Redirect Power BI reports to Snowflake |
67
68---
69
70## Migration Workflow Overview
71
72The migration process follows seven sequential phases. Each phase has entry criteria, deliverables,
73and validation gates that must pass before advancing.
74
75```text
761-Discovery → 2-Planning → 3-Placeholders → 4-Views → 5-Table Logic → 6-Testing → 7-Deployment
77```
78
79---
80
81## Phase 1: Discovery and Assessment
82
83Create a complete inventory of source database objects and understand dependencies, volumes, and
84complexity to inform migration planning.
85
86**SnowConvert AI Option**: If your platform is supported, SnowConvert AI provides extraction scripts
87that automate object inventory, dependency mapping, and initial code conversion.
88
89### Phase 1 Activities
90
911. **Inventory source objects**: Query system catalogs for tables, views, procedures, functions
922. **Document dependencies**: Map object dependencies to determine migration order
933. **Document volumes**: Record row counts and data sizes
944. **Assess complexity**: Categorize objects as Low/Medium/High/Custom complexity
955. **Create migration tracker**: Document objects in spreadsheet or issue tracker
96
97### Complexity Assessment
98
99| Complexity | Criteria | Examples |
100| ---------- | -------------------------------------- | ----------------------------- |
101| **Low** | Simple SELECT, no/minimal joins | Lookup tables, simple views |
102| **Medium** | Multiple joins, aggregations, CASE | Summary views, report queries |
103| **High** | Procedural logic, cursors, temp tables | SCD procedures, bulk loads |
104| **Custom** | Platform-specific features | Wrapped code, CLR functions |
105
106### Phase 1 Checklist
107
108- [ ] All tables, views, procedures inventoried
109- [ ] Row counts documented
110- [ ] Object dependencies mapped
111- [ ] Complexity assessment complete
112- [ ] Migration tracker created
113- [ ] Refresh frequencies identified
114
115---
116
117## Phase 2: Planning and Organization
118
119Organize legacy scripts, map objects to the dbt medallion architecture, and establish naming
120conventions before any conversion begins.
121
122### Phase 2 Activities
123
1241. **Organize legacy scripts**: Create folder structure (tables/, views/, stored_procedures/,
125 functions/)
1262. **Map to medallion layers**: Assign objects to Bronze/Silver/Gold with appropriate prefixes
1273. **Define naming conventions**: Follow $dbt-architecture skill patterns
1284. **Create dependency graph**: Visualize migration order
1295. **Establish validation criteria**: Define success metrics per object
130
131### Layer Mapping Reference
132
133| Source Object Type | Target Layer | dbt Prefix | Materialization |
134| -------------------- | ------------ | ---------- | --------------- |
135| Source tables (raw) | Bronze | `stg_` | ephemeral |
136| Simple views | Bronze | `stg_` | ephemeral |
137| Complex views | Silver | `int_` | ephemeral/table |
138| Dimension procedures | Gold | `dim_` | table |
139| Fact procedures | Gold | `fct_` | incremental |
140
141### Phase 2 Checklist
142
143- [ ] Legacy scripts organized in folders
144- [ ] All objects mapped to medallion layers
145- [ ] Naming conventions documented
146- [ ] Dependency graph created
147- [ ] Migration order established
148- [ ] Validation criteria defined
149
150---
151
152## Phase 3: Create Placeholder Models
153
154Create empty dbt models with correct column names, data types, and schema documentation **before**
155adding any transformation logic. This establishes the contract for downstream consumers.
156
157### Phase 3 Activities
158
1591. **Generate placeholder models**: Create SQL files with `null::datatype as column_name` pattern
160 and `where false`
1612. **Map datatypes**: Use platform-specific skill for datatype conversion to Snowflake types
1623. **Create schema documentation**: Generate `_models.yml` with column descriptions and tests
1634. **Validate compilation**: Run `dbt compile --select tag:placeholder`
1645. **Track status**: Add `placeholder` tag to config for tracking
165
166### Placeholder Model Pattern
167
168```sql
169{{ config(materialized='ephemeral', tags=['placeholder', 'bronze']) }}
170
171select
172 null::integer as column_id,
173 null::varchar(100) as column_name,
174 -- ... additional columns with explicit types
175where false
176```
177
178### Phase 3 Checklist
179
180- [ ] Placeholder model created for each target table
181- [ ] All columns have explicit datatype casts
182- [ ] Column names follow naming conventions
183- [ ] `_models.yml` created with descriptions and tests
184- [ ] All placeholder models compile successfully
185- [ ] Placeholder tag applied for tracking
186
187---
188
189## Phase 4: Convert Views
190
191Convert source database views to dbt models, starting with simple views before tackling complex
192ones. Views are typically easier than stored procedures as they contain declarative SQL.
193
194### Phase 4 Activities
195
1961. **Prioritize by complexity**: Simple views (no joins) → Join views → Aggregate views → Complex
197 views
1982. **Apply syntax translation**: Delegate to platform-specific skill (see Related Skills)
1993. **Structure with CTEs**: Use standard CTE pattern from $dbt-modeling skill
2004. **Add tests**: Define tests in `_models.yml` using $dbt-testing skill patterns
2015. **Replace placeholder logic**: Update placeholder SELECT with converted logic
202
203### Phase 4 Checklist
204
205- [ ] Views prioritized by complexity
206- [ ] Platform-specific syntax translated (delegate to source skills)
207- [ ] CTE pattern applied consistently
208- [ ] dbt tests added for each view
209- [ ] Converted views compile successfully
210- [ ] Inline comments document syntax changes
211
212---
213
214## Phase 5: Convert Table Logic from Stored Procedures
215
216Transform procedural stored procedure logic into declarative dbt models, selecting appropriate
217materializations for different ETL patterns.
218
219### Phase 5 Activities
220
2211. **Analyze ETL patterns**: Identify Full Refresh, SCD Type 1/2, Append, Delete+Insert patterns
2222. **Map to materializations**: Use pattern-to-materialization mapping from $dbt-materializations
223 skill
2243. **Break complex procedures**: Split single procedures into multiple intermediate/final models
2254. **Convert procedural constructs**: Replace cursors, temp tables, variables with declarative SQL
2265. **Document decisions**: Add header comments explaining conversion approach
227
228### Pattern Mapping Reference
229
230| Source Pattern | dbt Approach |
231| ---------------------- | ------------------------------------------- |
232| TRUNCATE + INSERT | `materialized='table'` |
233| UPDATE + INSERT (SCD1) | `materialized='incremental'` with merge |
234| SCD Type 2 | dbt snapshot or custom incremental |
235| INSERT only | `materialized='incremental'` append |
236| DELETE range + INSERT | `incremental` with `delete+insert` strategy |
237
238### Procedural to Declarative Conversion
239
240| Procedural Pattern | dbt Equivalent |
241| ------------------ | -------------------------------- |
242| CURSOR loop | Window function or recursive CTE |
243| Temp tables | CTEs or intermediate models |
244| Variables | Jinja variables or macros |
245| IF/ELSE branches | CASE expressions or `{% if %}` |
246| TRY/CATCH | Pre-validation tests |
247
248### Phase 5 Checklist
249
250- [ ] All stored procedures analyzed for patterns
251- [ ] ETL patterns mapped to dbt materializations
252- [ ] Complex procedures broken into multiple models
253- [ ] Procedural logic converted to declarative SQL
254- [ ] Conversion decisions documented in model headers
255- [ ] All converted models compile successfully
256
257---
258
259## Phase 6: End-to-End Testing and Validation
260
261Verify that migrated dbt models produce identical results to source system, using multiple
262validation techniques to ensure data integrity.
263
264**Snowflake Data Validation CLI**: For SQL Server, Teradata, or Redshift migrations, the
265[Data Validation CLI](https://docs.snowflake.com/en/migrations/snowconvert-docs/data-validation-cli/index)
266provides automated schema validation (columns, data types, row counts) and metrics validation (MIN,
267MAX, AVG, NULL count, DISTINCT count).
268
269### Phase 6 Activities
270
2711. **Row count validation**: Compare total counts between source and target
2722. **Column checksum validation**: Compare row-level hashes to identify differences
2733. **Business rule validation**: Verify calculated fields match source logic
2744. **Aggregate validation**: Compare summary metrics (sums, counts, averages)
2755. **Mock data testing**: Create seed fixtures for complex transformation testing
2766. **Incremental validation**: Test both full-refresh and incremental runs
2777. **Document results**: Create validation report for each migrated object
278
279### Validation Techniques
280
281| Technique | Purpose | Implementation |
282| -------------- | ------------------------- | ----------------------------- |
283| Row counts | Detect missing/extra rows | Compare COUNT(\*) |
284| Checksums | Detect value differences | SHA2 hash comparison |
285| Business rules | Verify logic accuracy | Singular tests |
286| Aggregates | Validate totals | SUM/AVG comparisons |
287| Mock data | Test transformations | Seed files + expected outputs |
288
289### Phase 6 Checklist
290
291- [ ] Row count validation queries created
292- [ ] Checksum comparison implemented
293- [ ] Business rule tests written
294- [ ] Aggregate metrics compared
295- [ ] Incremental models tested (full refresh + incremental)
296- [ ] All validation queries pass
297- [ ] Discrepancies documented and resolved
298- [ ] Validation report completed
299
300---
301
302## Phase 7: Deployment and Cutover
303
304Deploy validated dbt models to production with a clear cutover plan and monitoring strategy.
305
306### Phase 7 Activities
307
3081. **Deploy to Development**: Run `dbt build --target dev` and validate
3092. **Deploy to Test/UAT**: Run full validation suite with `--store-failures`
3103. **Create cutover plan**: Document pre-cutover, cutover, post-cutover, and rollback steps
3114. **Deploy to Production**: Execute deployment with production data
3125. **Configure scheduled runs**: Set up Snowflake tasks or dbt Cloud scheduling
3136. **Monitor post-deployment**: Track run duration, row counts, test failures, performance
314
315### Cutover Plan Template
316
317| Phase | Activities |
318| ------------------ | ------------------------------------------------------------------------------ |
319| Pre-Cutover (T-1) | Final validation, stakeholder sign-off, rollback docs, user communication |
320| Cutover (T-0) | Disable source ETL, final sync, deploy, build, validate, update BI connections |
321| Post-Cutover (T+1) | Monitor performance, verify schedules, confirm access, close tickets |
322| Rollback | Re-enable source ETL, revert BI connections, document issues |
323
324### Phase 7 Checklist
325
326- [ ] Development deployment successful
327- [ ] Test/UAT deployment successful
328- [ ] Cutover plan documented
329- [ ] Rollback procedure documented
330- [ ] Stakeholder sign-off obtained
331- [ ] Production deployment successful
332- [ ] Scheduled runs configured
333- [ ] Monitoring set up
334- [ ] Migration marked complete
335
336---
337
338## Related Skills
339
340### Platform-Specific Translation Skills
341
342For syntax translation, delegate to the appropriate source-specific skill:
343
344| Source Platform | Skill | Key Considerations |
345| -------------------------------- | ---------------------------- | ------------------------------------ |
346| Snowflake | $dbt-migration-snowflake | Convert Snowflake objects to dbt |
347| SQL Server / Azure Synapse | $dbt-migration-ms-sql-server | T-SQL, IDENTITY, TOP, #temp tables |
348| Oracle | $dbt-migration-oracle | PL/SQL, ROWNUM, CONNECT BY, packages |
349| Teradata | $dbt-migration-teradata | QUALIFY, BTEQ, volatile tables |
350| BigQuery | $dbt-migration-bigquery | UNNEST, STRUCT/ARRAY, backticks |
351| Redshift | $dbt-migration-redshift | DISTKEY/SORTKEY, COPY/UNLOAD |
352| PostgreSQL / Greenplum / Netezza | $dbt-migration-postgres | Array expressions, psql commands |
353| IBM DB2 | $dbt-migration-db2 | SQL PL, FETCH FIRST, handlers |
354| Hive / Spark / Databricks | $dbt-migration-hive | External tables, PARTITIONED BY |
355| Vertica | $dbt-migration-vertica | Projections, flex tables |
356| Sybase IQ | $dbt-migration-sybase | T-SQL variant, SELECT differences |
357
358---
359
360## Quick Reference: Phase Summary
361
362<!-- AGENT_WORKFLOW_METADATA: Machine-parseable phase definitions -->
363
364| Phase | Key Deliverable | Exit Criteria | Primary Skill | Validation Focus | Validation Command |
365| --------------- | ------------------------------------------- | ---------------------------------------- | ------------------------------------- | --------------------------------------------- | -------------------------------------- |
366| 1. Discovery | `migration_inventory.csv`, dependency graph | Inventory complete, dependencies mapped | This skill | Object counts, dependency completeness | Manual review |
367| 2. Planning | Folder structure, `_naming_conventions.md` | Folder structure created, naming defined | $dbt-architecture | Folder hierarchy, naming conventions | `ls -la models/` |
368| 3. Placeholders | `.sql` files, `_models.yml` | All models compile with `where false` | This skill | YAML structure, column definitions, naming | `dbt compile --select tag:placeholder` |
369| 4. Views | Converted view models | All views converted and compile | dbt-migration-{source}, $dbt-modeling | Syntax translation, CTE patterns, ref() usage | `dbt build --select tag:view` |
370| 5. Table Logic | Converted procedure models | All procedures converted | $dbt-materializations | Incremental configs, materialization patterns | `dbt build --select tag:procedure` |
371| 6. Testing | Validation queries, test results | All validation queries pass | $dbt-testing, $dbt-performance | Test coverage, constraint definitions | `dbt test --store-failures` |
372| 7. Deployment | Production models, monitoring | Production deployment successful | $dbt-commands, $snowflake-cli | Run success, schedule configuration | `dbt build --target prod` |
373
374### General Skills
375
376- $dbt-core: Local installation, configuration, package management
377- $snowflake-connections: Connection setup for Snowflake CLI, Streamlit, dbt
378
379---
380
381## Validation Requirements
382
383**CRITICAL: Agents must not advance to the next phase until all validations pass.**
384
385Before proceeding to each phase, verify:
386
3871. `dbt compile` succeeds
3882. `dbt test` passes
3893. Validation hooks report no errors
390
391Hook configuration is defined in `.claude/settings.local.json`.