Data migration¶
The Data Migration feature provides a fault-tolerant, scalable solution for moving data from external sources into Snowflake. This feature is specifically designed for cases where you are moving data from a system you plan to decommission.
Architecture overview¶
The Data Migration feature uses two main components: an Orchestrator and one or more Workers.
- The Orchestrator connects to the Snowflake account. It requires privileges to create and operate the
SNOWCONVERT_AIdatabase, where metadata is stored. - One or more Workers connect to both the source system and the Snowflake account. Workers read data from the source system and upload it to a Snowflake stage. Workers pick up tasks created by the Orchestrator and process them in parallel.
- Files uploaded to the Snowflake stage are copied into the target tables using a
COPY INTOstatement submitted and monitored by the Orchestrator.
Deployment options¶
The Orchestrator and Workers can be deployed in multiple ways:
- Both on Snowpark Container Services (in the Snowflake account).
- Both in the customer’s environment, including custom hardware, virtual machines, or containers.
- Orchestrator on Snowpark Container Services and Workers in the customer’s environment, or the other way around.
Prerequisites¶
Before you use Data Migration, make sure the following are in place:
- Snowflake AIM Agent for Data Warehouses: The agent will install and manage the worker and orchestrator runtimes and their dependencies as needed.
- Snowflake access: Connections for the Orchestrator and Workers in your Snowflake
config.tomlorconnections.toml, using a role that can create theSNOWCONVERT_AIdatabase and its objects. The first time the Orchestrator starts, it creates that database and related resources if they do not exist yet. On later runs, use a role that can administerSNOWCONVERT_AIand its objects; sticking with the same role you used for the initial creation is the simplest way to avoid permission issues. - Source connectivity: For typical source databases, an ODBC driver on the machine where Workers run. Oracle Workers require Oracle Instant Client and a registered ODBC driver. PostgreSQL Workers use the bundled Npgsql driver (no ODBC install). Programmatic Access Tokens (PATs) are recommended for Snowflake connections; see Connecting to Snowflake with a PAT.
- Hybrid Tables: Hybrid Tables must be enabled and available in your Snowflake account and region for this feature. Review Hybrid tables and Hybrid tables limitations so you understand relevant platform requirements.
- Snowpark Container Services (optional): If you deploy the Orchestrator or Workers on Snowflake compute, your account needs SPCS. See the Snowpark Container Services overview. Running both components outside Snowflake does not require SPCS.
Source-platform specifics¶
The Worker connects to your source using the TOML [connections.source.*] sections described in Worker configuration. Use the tabs below for connectivity, extraction style, and target options that are unique to each platform.
For Teradata only, the migration workflow’s extraction.strategy chooses among regular (default: partitioned SQL through the Worker to Parquet, then the internal migration stage), write_nos (Teradata WRITE_NOS writes Parquet to S3, Azure Blob, or GCS; Snowflake loads via an external stage you align to that bucket), and tpt (the Worker runs TPT EXPORT with tbuild, converts delimited output to Parquet, then uses the same internal stage path as regular).
- Driver: Install a supported Microsoft ODBC Driver for SQL Server on the Worker host (the Worker auto-detects a suitable driver when none is set). You can pin a driver with
odbc_driverin TOML. - Authentication: Use SQL authentication (
username/password) or Windows integrated security (use_windows_auth = trueon Windows Workers). - Encryption: Optional
encryptandtrust_server_certificatekeys follow ODBC Driver 17 vs 18 defaults; set explicitly for hardened or lab environments. - Bulk copy: Optional
use_bcp = trueenables BCP-style bulk extraction when supported for faster pulls from SQL Server. - Extraction path: Data is read through the Worker using regular extraction (ODBC/BCP). Size partitions with
partitionSizeandcolumnNamesToPartitionByin the workflow YAML.
- Connectivity: Use standard authentication (
auth_method = "standard", host, port5439) or IAM (auth_method = "iam-provisioned-cluster"withcluster_id,region, and AWS keys) in Worker TOML. For UNLOAD, configure optionalunload_s3_bucket,unload_s3_prefix, andunload_iam_role_arnso Redshift can write Parquet directly to S3; align that bucket with your Snowflake external stage used in the workflowextraction.externalStage. - Extraction strategy: In workflow JSON/YAML, set
"strategy": "unload"withexternalStagefor large Redshift-sourced tables (see Redshift UNLOAD). Use"regular"when the Worker pulls result sets over ODBC. - Iceberg targets on Snowflake: Redshift as a source does not prevent Apache Iceberg™ tables on Snowflake as targets. Set
target.tableTypeto"iceberg"and supplytarget.icebergConfig(catalog,externalVolume, optionalbaseLocationPrefix, external catalog fields, orcopy_files/sourceDataStageas applicable). See Iceberg configuration (target.icebergConfig) and Snowflake’s Iceberg tables documentation for account setup (external volume, catalog integration, privileges). - Throughput: UNLOAD + Iceberg
copy_filesor managed Iceberg loads often suit very large fact tables; usepartitionSize"auto"or larger MB targets when UNLOAD produces large Parquet objects.
Teradata supports three orchestrator extraction strategies. Pick one per table (or inherit from defaultTableConfiguration.extraction).
| Strategy | Workflow extraction.externalStage | Snowflake stage used for load | Worker / site requirements |
|---|---|---|---|
regular (default) | Omit | Internal migration stage (TASK_RESULTS pattern) | teradatasql or Teradata ODBC; optional odbc_driver, dbc_name, authentication |
write_nos | Required — must point at the same bucket/container Teradata writes to | External stage | write_nos_location_scheme (/s3/, /az/, /gs/), write_nos_location_host, write_nos_location_container, plus one credential mode (see below). Teradata NOS / WRITE_NOS enabled. |
tpt | Omit (do not set for tpt) | Internal migration stage (same as regular) | Teradata Tools and Utilities: tbuild on PATH or TPT_TBUILD_EXECUTABLE. Optional tpt_delimiter (default ASCII file separator U+001C), tpt_max_sessions (default 4). TPT scratch output/logs are created under the process temp directory by the Worker; do not rely on legacy tpt_output_directory / tpt_log_directory keys (they are ignored with a warning). |
regular — partitioned SQL extraction
The Worker runs partitioned SELECT streams. teradatasql is used when available; otherwise pyodbc with a registered Teradata ODBC driver. Pin the driver with odbc_driver (exact name from odbcinst -q -d on Linux/macOS or ODBC Administrator on Windows). A legacy driver_name field for the ODBC string may still be accepted; prefer odbc_driver. Use dbc_name when your COP / TDPID alias differs from host. Default gateway port 1025 unless your site uses another. Optional authentication (for example TD2, LDAP, KRB5).
write_nos — server-side export to object storage
The Worker executes Teradata WRITE_NOS so each partition lands in S3, Azure Blob, or GCS as Parquet. STOREDAS, compression, max object size, and overwrite behavior are fixed in the product path (not configured via Worker TOML). In [connections.source.teradata], set write_nos_location_scheme, write_nos_location_host, write_nos_location_container, and exactly one of: write_nos_function_mapping (recommended), write_nos_authorization_name, or write_nos_access_id plus write_nos_access_key. The Snowflake AIM Agent for Data Warehouses or worker packaging may ship a commented Teradata template with these keys.
tpt — Teradata Parallel Transporter on the Worker
The Worker generates a TPT EXPORT job, runs tbuild, converts delimited output to Parquet, then uploads like regular. Column metadata for the job comes from a WHERE 1=0 probe over the same Teradata connection (teradatasql or ODBC). tpt_delimiter must stay single-byte if you override it (required for the CSV-to-Parquet step).
Partitioning and load
Use columnNamesToPartitionBy on skew-aware keys and tune partitionSize for large tables. With partitionSize: "auto", the orchestrator applies a Teradata-specific profile for regular (smaller partitions, friendlier to Worker memory). write_nos and tpt currently use the generic auto fallback profile (moderate MB targets) until dedicated profiles exist—set an explicit partitionSize object if you need tighter control. Teradata systems are often CPU and BYNET sensitive; keep Worker parallelism moderate and coordinate with your DBA.
Oracle is supported for cloud data migration through the same scai data migrate … workflow commands as SQL Server and Amazon Redshift (start, generate-config, create-workflow, plus shared scai data worker and scai data orchestrator commands).
- Project and connection: Initialize with
scai init <name> -l Oracle. Register the source withscai connection add-oracle(standard authentication:host,service-name, port 1521 by default). Set the default profile withscai connection set-default -l oracle -s <profile-name>. - ODBC on Workers: Install Oracle Instant Client and a matching ODBC driver on each Worker host. When
scaistarts a Worker from an Oracle project, it installs theoraclepip extra group for the Data Exchange Worker environment. - Worker TOML: Use
[connections.source.oracle]. Setoracle_connection_modetobasic(EZConnect;databaseis the service name),tns_alias(withtns_nameand optionaltns_admin), orconnect_descriptorfor a fullDESCRIPTIONblock. Setodbc_driverto the exact name frompyodbc.drivers()on the Worker host, or useauto_detect_driverwhen appropriate. Optionalwallet_directory/wallet_passwordsupport wallet-based TLS; pass additional ODBC attributes throughextra_optionswhen needed. - Extraction: Use workflow
extraction.strategyregular(partitionedSELECTthrough the Worker to Parquet, then the internal migration stage). TunecolumnNamesToPartitionByandpartitionSizefor large tables. - Incremental sync: Use
synchronization.strategynoneorwatermark.checksumis not supported for Oracle;scai data migrate generate-configand workflow validation rejectchecksumon Oracle projects. - Workflow YAML: Declare tables like other sources (
source.databaseName,schemaName,tableName, optionalwhereClauseCriteria, native or Iceberg targets). The orchestrator recordsoracleasSOURCE_PLATFORMfrom your project dialect.
Example: setup and local cloud migration run
PostgreSQL is supported for cloud data migration through the same scai data migrate … workflow commands as SQL Server, Amazon Redshift, and Oracle (start, generate-config, create-workflow, plus shared scai data worker and scai data orchestrator commands).
- Project and connection: Initialize with
scai init <name> -l Postgresql. Register the source withscai connection add-postgresql(standard authentication:host,database, port 5432 by default). Set the default profile withscai connection set-default -l postgresql -s <profile-name>. - Driver on Workers: Workers connect with Npgsql (pure Python). You do not install a PostgreSQL ODBC driver for cloud migration. Set
ssl_modein Worker TOML (Disable,Prefer,Require,VerifyCA,VerifyFull; defaultRequirefor managed hosts; useDisablefor local Docker or lab instances without TLS). - Worker TOML: Use
[connections.source.postgresql]withauth_method = "standard",host,port,database,username,password, andssl_mode. - Extraction: Use workflow
extraction.strategyregular(partitionedSELECTthrough the Worker to Parquet, then the internal migration stage). TunecolumnNamesToPartitionByandpartitionSizefor large tables. - Incremental sync: Use
synchronization.strategynone,watermark, orchecksum(same as SQL Server and Redshift unless your workflow validation rejects a strategy for a specific table). - Workflow YAML: Declare tables like other sources (
source.databaseName,schemaName,tableName, optionalwhereClauseCriteria, native or Iceberg targets). The orchestrator recordspostgresqlasSOURCE_PLATFORMfrom your project dialect.
Example: setup and local cloud migration run
Usage¶
To migrate data using this solution, complete the following high-level steps:
- Start the Orchestrator.
- Start the Workers.
- Create a Data Migration Workflow.
- Monitor the Data Migration Workflow until completion.
A Data Migration Workflow is essentially an action or goal for the system to complete, such as migrating a specific set of tables with a given configuration. You can submit multiple workflows simultaneously and monitor them. The Orchestrator breaks Data Migration Workflows into smaller tasks, which typically involves splitting a table into partitions before extracting its data and loading it to Snowflake.
Ask the Snowflake AIM Agent for Data Warehouses to run cloud data migration steps by prompting
Considerations and recommendations¶
Connecting to Snowflake with a PAT¶
It is recommended to use Programmatic Access Tokens (PAT) for connections used by the Orchestrator and Workers. This ensures there is no need to constantly authenticate through the browser or with an authenticator app. You will need to establish a Network Policy or temporarily bypass the requirement for a Network Policy (this can be done from Snowsight).
Running Orchestrator and Workers on SPCS¶
To leverage Snowflake compute for these tasks:
- Prepare Docker images that bundle the Orchestrator and Worker runtimes and configuration (see Snowflake guidance for SPCS service images).
- Push those Docker images to an Image Repository in Snowflake.
- Execute the Orchestrator and/or Worker images using Snowpark Container Services.
Keep the following in mind:
- It is recommended to execute them as Services, not Jobs.
- It is possible to run only one component (Orchestrator or Workers) in SPCS and the other on a different platform.
- It is a good practice to monitor the SPCS service and suspend it when it is not being used.
- Depending on the network configuration of the source system, you may need to configure an External Access Integration so that these services can connect to your source system.
Initial testing¶
It is recommended to deploy the DDL for the tables you want to migrate before starting data migration. This ensures the target type matches the behavior you want to see in the table and its related views and procedures. You can convert DDL from your source dialect into Snowflake SQL using the code conversion capabilities of the Snowflake AIM Agent for Data Warehouses.
Note
If you don’t deploy the DDL for the tables before starting data migration, the types will be inferred, which may not be as accurate as required.
Managing Workers¶
The time it takes to complete a workflow depends on many variables, but the number of Workers (and threads per Worker) has the greatest impact, as it determines how many extraction tasks can be executed in parallel. Consider the following:
- It is not necessary to run two Workers on the same machine. If you want more parallelism on a single machine, increase the thread count instead.
- Network bandwidth greatly affects Worker speed and is shared between threads of a Worker.
- Even with many Workers and threads running in parallel, the source system might not have enough resources to handle the load.
- Keep a low Worker count to avoid overloading your source system.
- Consider stopping some or all Workers when the source system is already under heavy load from other operations.