Home Database Migration Guide: From Redshift, BigQuery & Legacy Warehouses
Advanced 3 min · July 17, 2026
Migrating to Snowflake: From Redshift, BigQuery, and Legacy Warehouses

Migration Guide: From Redshift, BigQuery & Legacy Warehouses

Learn how to migrate from Redshift, BigQuery, or legacy warehouses to Snowflake.

N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Notes here come from systems that actually shipped.

Follow
Production
production tested
July 17, 2026
last updated
2,439
articles · all by Naren
Before you start⏱ 15-20 min read
  • Basic knowledge of SQL and data warehousing concepts.
  • Access to source warehouse and Snowflake account.
  • Understanding of cloud storage (S3, GCS, Azure Blob).
  • Familiarity with ETL/ELT processes.
 ● Production Incident 🔎 Debug Guide ⚙ Triage Commands
Quick Answer

Migrating to Snowflake involves assessing your source warehouse, converting DDL and DML, handling data types, optimizing storage, and testing performance. Key differences include Snowflake's separation of compute and storage, automatic clustering, and zero-copy cloning.

✦ Definition~90s read
What is Migrating to Snowflake?

Migrating to Snowflake is the process of moving your data, schemas, and workloads from another data warehouse (like Redshift, BigQuery, or legacy systems) to Snowflake's cloud-native platform.

Think of migrating to Snowflake like moving from an old apartment (your current warehouse) to a new, modern one.
Plain-English First

Think of migrating to Snowflake like moving from an old apartment (your current warehouse) to a new, modern one. You need to pack your furniture (data), label boxes (convert schemas), and maybe change some items (data types). Snowflake is like a smart building where you can add or remove rooms (compute) as needed, and you never have to worry about cleaning (automatic optimization).

Migrating to Snowflake from Amazon Redshift, Google BigQuery, or a legacy data warehouse is a strategic move for many organizations seeking better scalability, performance, and cost management. Snowflake's unique architecture—separating storage and compute, automatic scaling, and near-zero maintenance—makes it an attractive target. However, migration is not trivial. Differences in SQL syntax, data types, partitioning, and performance optimization require careful planning. This guide provides a practical, step-by-step approach to migrating your data warehouse to Snowflake. We'll cover schema conversion, data transfer, query adaptation, and common pitfalls. Whether you're moving from a traditional on-premise warehouse or a cloud-based solution, you'll find actionable advice and real-world examples. By the end, you'll be equipped to execute a smooth migration with minimal downtime.

1. Assessing Your Source Warehouse

Before migrating, thoroughly assess your current data warehouse. Identify all databases, schemas, tables, views, stored procedures, and user-defined functions. Document data types, indexes, partitioning schemes, and any proprietary features. For Redshift, note sort keys and distribution styles. For BigQuery, note clustering and partitioning. For legacy warehouses, capture any custom SQL dialects. This assessment will guide your conversion strategy. Create a migration plan that includes a timeline, resource allocation, and rollback procedures. Use Snowflake's Migration Assessment Tool if available.

assess_source.sqlSQL
1
2
3
4
5
-- Redshift: Get table DDL
SELECT pg_catalog.pg_get_viewdef('schema.table_name', true);
-- BigQuery: Get table info
SELECT table_name, table_type, ddl FROM `project.dataset.INFORMATION_SCHEMA.TABLES`;
-- Legacy: Use SHOW CREATE TABLE or equivalent
Output
Collect all DDL statements for conversion.
💡Automate Assessment
📊 Production Insight
Many legacy warehouses have undocumented features or custom scripts; include them in your assessment.
🎯 Key Takeaway
Document all source objects and their properties before migration.

2. Converting DDL and Data Types

Snowflake uses a different SQL dialect and data type system. Map source types to Snowflake equivalents: Redshift's BIGINT to NUMBER(38,0), TIMESTAMP to TIMESTAMP_NTZ, VARCHAR to VARCHAR. BigQuery's ARRAY<STRUCT> to VARIANT, GEOGRAPHY to GEOGRAPHY. Legacy types like MONEY to NUMBER(19,4). Use Snowflake's CONVERT function or manual CAST. For DDL, replace Redshift's DISTKEY and SORTKEY with Snowflake's clustering keys. BigQuery's partitioning becomes Snowflake's automatic clustering. Legacy indexes are not needed; Snowflake uses automatic micro-partitioning. Example conversion: Redshift CREATE TABLE with DISTKEY and SORTKEY becomes Snowflake CREATE TABLE with CLUSTER BY.

convert_ddl.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- Redshift original
CREATE TABLE orders (
  order_id BIGINT,
  order_date TIMESTAMP,
  customer_id BIGINT,
  amount DECIMAL(10,2)
) DISTKEY(customer_id) SORTKEY(order_date);

-- Snowflake converted
CREATE OR REPLACE TABLE orders (
  order_id NUMBER(38,0),
  order_date TIMESTAMP_NTZ,
  customer_id NUMBER(38,0),
  amount NUMBER(10,2)
) CLUSTER BY (order_date);
⚠ Data Type Precision
📊 Production Insight
BigQuery's REPEATED fields (ARRAY) are best stored as VARIANT in Snowflake; use FLATTEN for queries.
🎯 Key Takeaway
Map each source data type to the most appropriate Snowflake type, considering precision and performance.

3. Data Transfer Strategies

Choose a data transfer method based on volume and latency requirements. Options: 1) COPY INTO from cloud storage (S3, GCS, Azure Blob) using external stages. 2) Snowpipe for continuous ingestion. 3) Third-party ETL tools (Fivetran, Matillion). 4) Custom scripts using Snowflake's Python connector. For large datasets, use COPY INTO with compression (gzip, snappy). Use VALIDATION_MODE to catch errors before loading. Example: unload from Redshift to S3 as CSV, then COPY into Snowflake. For BigQuery, export to GCS as Parquet. For legacy, use ODBC/JDBC bulk export.

data_transfer.sqlSQL
1
2
3
4
5
6
7
8
9
10
-- Create external stage pointing to S3
CREATE OR REPLACE STAGE my_stage
  URL='s3://my-bucket/data/'
  CREDENTIALS=(AWS_KEY_ID='...' AWS_SECRET_KEY='...');

-- COPY into Snowflake with error handling
COPY INTO orders
  FROM @my_stage/orders/
  FILE_FORMAT = (TYPE = CSV FIELD_OPTIONALLY_ENCLOSED_BY='"')
  VALIDATION_MODE = 'RETURN_ERRORS';
Output
Errors are returned; fix and re-run.
🔥Compression Matters
📊 Production Insight
For very large tables, consider splitting data into multiple files and using parallel COPY commands.
🎯 Key Takeaway
Use COPY INTO with validation to ensure data integrity during transfer.

4. Query Adaptation and Optimization

Rewrite queries to leverage Snowflake's features. Replace Redshift's window functions with Snowflake's (similar but check syntax). BigQuery's UNNEST becomes LATERAL FLATTEN. Legacy SQL might need CTEs or subqueries. Optimize by using clustering keys on frequently filtered columns, materialized views for aggregations, and result caching. Avoid anti-patterns like SELECT * in production. Use query profiles to identify bottlenecks. Example: convert a Redshift query with DISTKEY join to Snowflake without explicit distribution.

query_adaptation.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Redshift: Join on distribution key
SELECT o.order_id, c.name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;

-- Snowflake: No distribution needed; just join
SELECT o.order_id, c.name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;

-- BigQuery UNNEST to Snowflake FLATTEN
-- BigQuery: SELECT * FROM table, UNNEST(arr) AS element
-- Snowflake: SELECT * FROM table, LATERAL FLATTEN(input=>arr) AS element
💡Use Query Profiling
📊 Production Insight
Snowflake's automatic query optimization often eliminates the need for manual tuning, but clustering keys are still beneficial.
🎯 Key Takeaway
Rewrite queries to use Snowflake's syntax and optimize with clustering and materialized views.

5. Handling Stored Procedures and UDFs

Migrate stored procedures and UDFs to Snowflake's JavaScript or SQL-based procedures. Redshift's PL/pgSQL can be converted to Snowflake's JavaScript stored procedures. BigQuery's UDFs in SQL or JavaScript can be ported directly. Legacy procedures may need significant rewriting. Use Snowflake's CREATE PROCEDURE with LANGUAGE JAVASCRIPT. For simple logic, use SQL UDFs. Test each procedure with sample data. Example: convert a Redshift procedure to Snowflake.

stored_procedure.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Redshift procedure (PL/pgSQL)
CREATE OR REPLACE PROCEDURE update_orders()
LANGUAGE plpgsql
AS $$
BEGIN
  UPDATE orders SET status = 'processed' WHERE order_date < CURRENT_DATE;
END;
$$;

-- Snowflake procedure (JavaScript)
CREATE OR REPLACE PROCEDURE update_orders()
RETURNS VARCHAR
LANGUAGE JAVASCRIPT
AS
$$
  var sql = "UPDATE orders SET status = 'processed' WHERE order_date < CURRENT_DATE";
  snowflake.execute({sqlText: sql});
  return 'Updated';
$$;
⚠ JavaScript Limitations
📊 Production Insight
Consider replacing complex procedures with Snowflake tasks and streams for modern data pipelines.
🎯 Key Takeaway
Convert stored procedures to Snowflake's JavaScript or SQL syntax, testing thoroughly.

6. Testing and Validation

After migration, validate data integrity and performance. Compare row counts, checksums, and sample records between source and target. Use MINUS to find differences. Run a subset of production queries and compare results. Test with concurrent users to assess warehouse scaling. Monitor Snowflake's query history and account usage. Create a rollback plan if issues arise. Example: validate using MINUS.

validation.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Compare row counts
SELECT COUNT(*) FROM source_table;
SELECT COUNT(*) FROM target_table;

-- Find differences using MINUS
SELECT * FROM source_table
MINUS
SELECT * FROM target_table;

-- Check for extra rows
SELECT * FROM target_table
MINUS
SELECT * FROM source_table;
Output
If no rows returned, tables match.
🔥Automate Validation
📊 Production Insight
Run parallel queries on both systems for a period to catch any discrepancies.
🎯 Key Takeaway
Thoroughly validate data and performance before decommissioning the source warehouse.

7. Post-Migration Optimization

After migration, optimize Snowflake for cost and performance. Set up resource monitors to control costs. Enable auto-suspend for warehouses. Use automatic clustering and materialized views. Implement time travel retention as needed. Monitor with Snowflake's built-in tools. Consider using Snowflake's search optimization service for point lookup queries. Example: create a resource monitor.

optimization.sqlSQL
1
2
3
4
5
6
7
8
9
10
-- Create resource monitor
CREATE OR REPLACE RESOURCE MONITOR my_monitor
  WITH CREDIT_QUOTA = 1000
  FREQUENCY = MONTHLY
  START_TIMESTAMP = '2025-01-01 00:00:00'
  TRIGGERS ON 80 PERCENT DO NOTIFY
           ON 100 PERCENT DO SUSPEND;

-- Assign to warehouse
ALTER WAREHOUSE my_wh SET RESOURCE_MONITOR = my_monitor;
💡Cost Management
📊 Production Insight
Snowflake's consumption-based pricing means idle warehouses cost money; always set auto-suspend.
🎯 Key Takeaway
Continuously monitor and optimize Snowflake after migration for best performance and cost.
● Production incidentPOST-MORTEMseverity: high

The Midnight Migration Meltdown

Symptom
Users saw 'ERROR: Unsupported data type' and queries failed after migration.
Assumption
The developer assumed all BigQuery data types had direct Snowflake equivalents.
Root cause
BigQuery's GEOGRAPHY and ARRAY<STRUCT> types were not directly supported in Snowflake; they required conversion to GEOGRAPHY and VARIANT.
Fix
Converted GEOGRAPHY columns using ST_GEOGRAPHYFROMTEXT and ARRAY<STRUCT> to VARIANT using PARSE_JSON.
Key lesson
  • Always map source data types to target types before migration.
  • Test with a subset of data first.
  • Use Snowflake's COPY INTO with schema detection for complex types.
  • Document all type conversions for future reference.
  • Plan for rollback in case of issues.
Production debug guideSymptom to Action4 entries
Symptom · 01
Queries run slower than expected after migration
Fix
Check if automatic clustering is enabled; review query profiles and warehouse size.
Symptom · 02
Data type conversion errors during COPY INTO
Fix
Use VALIDATION_MODE = 'RETURN_ERRORS' to identify problematic rows.
Symptom · 03
Inconsistent results between source and target
Fix
Compare row counts and checksums; use MINUS to find differences.
Symptom · 04
High storage costs
Fix
Enable automatic clustering and time travel retention to minimum; compress data before loading.
★ Quick Debug Cheat SheetCommon migration issues and immediate actions.
COPY INTO fails with type mismatch
Immediate action
Use VALIDATION_MODE to get error details
Commands
COPY INTO table FROM @stage VALIDATION_MODE = 'RETURN_ERRORS';
SELECT * FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));
Fix now
Convert source data to correct types using SELECT with CAST.
Query performance degradation+
Immediate action
Check warehouse size and concurrency
Commands
SHOW WAREHOUSES;
SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY WHERE QUERY_TEXT LIKE '%your_query%';
Fix now
Resize warehouse or add clustering keys.
Data inconsistency+
Immediate action
Compare row counts
Commands
SELECT COUNT(*) FROM source_table;
SELECT COUNT(*) FROM target_table;
Fix now
Re-run migration for affected tables using MINUS to identify missing rows.
FeatureRedshiftBigQuerySnowflake
Compute/StorageTiedSeparated (slots)Separated (warehouses)
ClusteringSort keysClusteringAutomatic clustering
Data TypesLimitedRich (ARRAY, STRUCT)Rich (VARIANT, GEOGRAPHY)
PricingPay per nodePay per slotPay per credit (compute + storage)
IndexingYesNoNo (micro-partitions)
⚙ Quick Reference
7 commands from this guide
FileCommand / CodePurpose
assess_source.sqlSELECT pg_catalog.pg_get_viewdef('schema.table_name', true);1. Assessing Your Source Warehouse
convert_ddl.sqlCREATE TABLE orders (2. Converting DDL and Data Types
data_transfer.sqlCREATE OR REPLACE STAGE my_stage3. Data Transfer Strategies
query_adaptation.sqlSELECT o.order_id, c.name4. Query Adaptation and Optimization
stored_procedure.sqlCREATE OR REPLACE PROCEDURE update_orders()5. Handling Stored Procedures and UDFs
validation.sqlSELECT COUNT(*) FROM source_table;6. Testing and Validation
optimization.sqlCREATE OR REPLACE RESOURCE MONITOR my_monitor7. Post-Migration Optimization

Key takeaways

1
Assess your source warehouse thoroughly before migration.
2
Map data types and DDL carefully to Snowflake equivalents.
3
Use COPY INTO with validation for data transfer.
4
Rewrite queries and stored procedures to leverage Snowflake's features.
5
Validate data integrity and performance post-migration.
6
Optimize for cost and performance with resource monitors and clustering.

Common mistakes to avoid

4 patterns
×

Not mapping data types correctly

×

Ignoring query performance differences

×

Forgetting to set up resource monitors

×

Migrating all data at once without validation

INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01SENIOR
What are the key differences between Snowflake and Redshift that affect ...
Q02SENIOR
How would you migrate a BigQuery table with nested and repeated fields t...
Q03SENIOR
Explain how to validate data integrity after migration.
Q04SENIOR
What are common pitfalls when migrating from legacy warehouses to Snowfl...
Q01 of 04SENIOR

What are the key differences between Snowflake and Redshift that affect migration?

ANSWER
Snowflake separates compute and storage, uses automatic clustering instead of sort keys, and has a different SQL dialect. Redshift requires manual distribution and sort keys.
FAQ · 5 QUESTIONS

Frequently Asked Questions

01
What is the best way to transfer large datasets to Snowflake?
02
How do I handle data type differences between Redshift and Snowflake?
03
Can I keep my existing ETL tools when migrating to Snowflake?
04
How do I migrate stored procedures from Redshift to Snowflake?
05
What is the downtime during migration?
N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Notes here come from systems that actually shipped.

Follow
Verified
production tested
July 17, 2026
last updated
2,439
articles · all by Naren
🔥

That's Snowflake. Mark it forged?

3 min read · try the examples if you haven't

Previous
Business Continuity: Replication, Failover, and Disaster Recovery
23 / 33 · Snowflake
Next
CI/CD: Terraform, dbt, and Schema Evolution