How to Migrate from Snowflake to Redshift in PostgreSQL

Galaxy Glossary

How do I migrate data from Snowflake to Redshift safely?

Move tables, schema, and data from Snowflake to Amazon Redshift with minimal downtime.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Description

Table of Contents

Why migrate from Snowflake to Redshift?

Teams switch when they consolidate on AWS, need cheaper storage tiers, or want closer integration with existing Redshift workloads.

What are the high-level steps?

1) Export Snowflake data to external storage (S3). 2) Create matching schemas in Redshift. 3) COPY data from S3 into Redshift. 4) Validate row counts and constraints. 5) Swap production endpoints.

How do I export Snowflake tables to S3?

Use the Snowflake UNLOAD command with AWS credentials.Partition large tables to parallelize exports and minimize wall-clock time.

UNLOAD INTO 's3://my-bucket/ecomm/customers/'
CREDENTIALS = (AWS_KEY_ID='…' AWS_SECRET_KEY='…')
FILE_FORMAT = (TYPE=CSV FIELD_OPTIONALLY_ENCLOSED_BY='"')
OVERWRITE=TRUE
AS SELECT * FROM Customers;

How do I create equivalent tables in Redshift?

Define tables with matching column names, data types, and primary keys.Add sort and distribution keys for query performance.

CREATE TABLE customers (
id INT NOT NULL,
name VARCHAR(100),
email VARCHAR(255),
created_at TIMESTAMP
)
DISTSTYLE KEY DISTKEY(id)
SORTKEY(id);

How do I load data into Redshift?

Run COPY from S3 paths generated by Snowflake’s UNLOAD.Compress files with GZIP or Snappy for faster transfer.

COPY customers
FROM 's3://my-bucket/ecomm/customers/'
IAM_ROLE 'arn:aws:iam::123456789:role/redshift-s3-access'
CSV IGNOREHEADER 1;

How do I migrate incremental changes?

After initial full load, schedule CDC exports using Snowflake streams or updated_at filters, then COPY into staging tables and MERGE into targets.

How can I validate the migration?

Compare counts and checksums between Snowflake and Redshift for each table.Run application smoke tests on Redshift replicas before cut-over.

Best practices for large ecommerce databases?

Export and load tables in parallel batches, compress files, pick DISTKEYs that match common join columns like customer_id, and use automatic table vacuuming after loads.

What is the rollback strategy?

Keep Snowflake in read-only mode during cut-over. If issues arise, point applications back to the Snowflake connection string until fixed.

.

Why How to Migrate from Snowflake to Redshift in PostgreSQL is important

How to Migrate from Snowflake to Redshift in PostgreSQL Example Usage


-- Migrate the Orders table
UNLOAD INTO 's3://shop-exports/orders/'
CREDENTIALS = (AWS_KEY_ID='AKIA…' AWS_SECRET_KEY='ABC…')
FILE_FORMAT = (TYPE=CSV FIELD_OPTIONALLY_ENCLOSED_BY='"')
OVERWRITE=TRUE
AS SELECT * FROM Orders;

CREATE TABLE orders (
  id            INT   NOT NULL,
  customer_id   INT,
  order_date    DATE,
  total_amount  NUMERIC(12,2)
) DISTSTYLE KEY DISTKEY(customer_id) SORTKEY(order_date);

COPY orders
FROM 's3://shop-exports/orders/'
IAM_ROLE 'arn:aws:iam::123456789012:role/redshift-s3-access'
CSV IGNOREHEADER 1;

How to Migrate from Snowflake to Redshift in PostgreSQL Syntax


UNLOAD INTO 's3://bucket/path/'
  CREDENTIALS=(AWS_KEY_ID='<key>' AWS_SECRET_KEY='<secret>')
  FILE_FORMAT=(TYPE=CSV FIELD_OPTIONALLY_ENCLOSED_BY='"')
  AS SELECT * FROM <table>;

CREATE TABLE <table> (
  column definitions
) DISTSTYLE {KEY|ALL|EVEN} DISTKEY(column) SORTKEY(column);

COPY <table>
FROM 's3://bucket/path/'
IAM_ROLE '<arn>'
CSV [GZIP] IGNOREHEADER 1
[DATEFORMAT 'auto'] [TIMEFORMAT 'auto']
;

Common Mistakes

Frequently Asked Questions (FAQs)

Can I migrate without S3?

No. Redshift COPY reads only from S3, DynamoDB, or Kinesis. S3 is the standard bridge for Snowflake exports.

How long does a 1-TB migration take?

With parallel UNLOAD/COPY and GZIP, expect 30-60 minutes depending on network bandwidth and cluster size.

Does Redshift support Snowflake’s zero-copy cloning?

No. Redshift requires physical copies. Use snapshots for fast environment duplication.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.