Migrate dbt projects to run on Snowflake. Triggers: migrate, env_var, environment variable, convert to var, migration, prepare for snowflake.
Main skill routes here for: "migrate", "env_var", "environment variable", "convert to var", "migration", "prepare for snowflake"
This is an ACTION skill - proceed with creation of dbt project. Do not just analyze and report.
This skill helps migrate existing dbt projects to run on Snowflake.
⚠️ MANDATORY — DO THIS FIRST BEFORE ANY OTHER CHANGES ⚠️
You MUST create a copy of the project BEFORE making any edits. NEVER modify, edit, delete, or rename any file in the original project directory. The original must remain byte-for-byte identical after migration.
cp -r <original_project> <original_project>_snowflake
Example:
cp -r /path/to/my_project /path/to/my_project_snowflake
ALL subsequent edits go to the _snowflake copy ONLY. Double-check every file path before editing — if it doesn't contain _snowflake, STOP and fix the path.
Exception: Only edit in-place if the user explicitly requests it (e.g., "edit files directly", "modify in place").
Whenever you replace an env_var() call with a literal value (in profiles.yml, dbt_project.yml, or packages.yml), resolve it using this priority order:
env_var() second argument — e.g., env_var('START_DATE', '2024-01-01') → use "2024-01-01"echo $VAR_NAME in bash for every env var that lacks a second argument. Do NOT skip this step. Batch multiple variables in one command: echo "SNOWFLAKE_ACCOUNT=$SNOWFLAKE_ACCOUNT SNOWFLAKE_ROLE=$SNOWFLAKE_ROLE ..."echo returned empty) — use TODO_INSERT_<VAR_NAME> placeholder and tell the user which values need to be filled in before deploymentUpdate profiles.yml for Snowflake-hosted dbt:
CRITICAL: Snowflake-hosted dbt does NOT support env_var() in profiles.yml!
You must:
password, authenticator, private_key_path, private_key_passphrase, token) - authentication is handled by the Snowflake sessiondatabase, warehouse, schema, etc.env_var() calls with literal values using the resolution priority aboveBefore (local dbt with env_var and password):