
To migrate from Fivetran to Sling, write one Sling replication file for each Fivetran connection. Map each sync mode to a Sling mode, run Sling into a separate schema for some days, compare the row counts, then change the downstream models and pause the Fivetran connection.
This guide is for database connections, such as Postgres to Snowflake. It covers:
- How the Fivetran sync modes map to Sling
- How to export the configuration of a connection
- A run on Postgres and Snowflake
- What to do with the
_fivetran_columns - When Fivetran is the better choice
If you have not decided to move yet, read Sling vs Fivetran for the comparison and the cost model for the pricing.
How do Fivetran sync modes map to Sling?
Each Fivetran sync mode maps to a Sling mode and a small number of options. Fivetran has three sync modes: soft delete, live, and history.
| Fivetran | Sling | Notes |
|---|---|---|
| Soft delete mode | incremental with primary_key and update_key, plus delete_missing: soft | The update_key is the cursor. The primary_key makes the load a MERGE. Deleted rows get _sling_deleted_at. |
| Live mode (exact copy of the source) | incremental with delete_missing: hard, or full-refresh | hard removes target rows that are not in the source. |
| History mode (SCD Type 2) | incremental, with history kept downstream | Sling does not write row versions. Use a dbt snapshot or a history table on the loaded table. |
| Table with no primary key | incremental with update_key only | Append only. Fivetran adds _fivetran_id for these tables. Sling does not. |
delete_missing is a CLI Pro feature. It reads all primary keys from the source on each run. On a large table, scope it with source_where and target_where (see Capture deletes).
If you need log-based capture, Sling CDC reads the transaction log of MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, and MongoDB. CDC needs a CLI Pro Max token or the Advanced Platform plan (see Change Capture).
How do you export a Fivetran connection configuration?
Get the configuration from the Fivetran REST API or from your Terraform state. You do not need to copy it from the dashboard.
curl -s -u "$FIVETRAN_API_KEY:$FIVETRAN_API_SECRET" \
https://api.fivetran.com/v1/connections/{connectionId}
The Retrieve Connection Details endpoint returns the connection object with its configuration. If Terraform manages Fivetran, the same data is in the fivetran_connection or fivetran_connection_v2 resources, or in the legacy fivetran_connector resource. Get the table list, the sync mode, and the primary keys from it.
What does the replication file look like?
One Fivetran connection becomes one replication file. This is the file for the run in the next section:
source: PG_SLING_DEV
target: SNOWFLAKE
defaults:
mode: incremental
object: demo_fivetran_migration.{stream_table}
streams:
demo_fivetran_migration.customers:
primary_key: [customer_id]
update_key: updated_at
demo_fivetran_migration.products:
primary_key: [product_id]
update_key: updated_at
demo_fivetran_migration.orders:
primary_key: [order_id]
update_key: ordered_at
source and target are connection names in ~/.sling/env.yaml (see environment). Fivetran selects a cursor column for you. In Sling, you name it in update_key.
What does the first run look like?
The first run is a full load, because the target tables do not exist:
$ sling run -r replication.yaml
...
INF inserted 20000 rows into "DEMO_FIVETRAN_MIGRATION"."CUSTOMERS" in 14 secs [1,421 r/s]
INF inserted 3000 rows into "DEMO_FIVETRAN_MIGRATION"."PRODUCTS" in 13 secs [230 r/s]
INF inserted 85000 rows into "DEMO_FIVETRAN_MIGRATION"."ORDERS" in 13 secs [6,411 r/s]
INF Sling Replication Completed in 43s | PG_SLING_DEV -> SNOWFLAKE | 3 Successes | 0 Failures
Then we added 2,500 orders with a newer ordered_at, changed two customers, and ran the same file again:
$ sling run -r replication.yaml
INF [1 / 3] running stream demo_fivetran_migration.customers
INF getting checkpoint value (updated_at)
INF inserted 2 rows into "DEMO_FIVETRAN_MIGRATION"."CUSTOMERS" in 12 secs
INF [2 / 3] running stream demo_fivetran_migration.products
INF getting checkpoint value (updated_at)
WRN no data or records found in stream. Nothing to do.
INF [3 / 3] running stream demo_fivetran_migration.orders
INF getting checkpoint value (ordered_at)
INF inserted 2500 rows into "DEMO_FIVETRAN_MIGRATION"."ORDERS" in 14 secs [173 r/s]
The two changed customers merged into their rows. Products had no new rows. Orders loaded only the 2,500 rows after the last cursor value.
Where does Sling keep the sync state?
For a database target, the state is the target table. Before each incremental run, Sling reads the maximum update_key value from the target and reads only newer source rows. The function is getIncrementalValueViaDB in core/sling/task_func.go.
Thus there is no state to move from Fivetran. Fivetran keeps its cursor in its own service. Sling starts from the data that is in the target.
What happens to the _fivetran_ columns?
Sling does not write the Fivetran system columns. A dbt model or a freshness check that reads them stops working after the cutover. Find each reference before you cut over, and change it to the Sling column:
| Fivetran column | Fivetran meaning | Sling replacement |
|---|---|---|
_fivetran_synced | When Fivetran last synced the row | _sling_loaded_at, with SLING_LOADED_AT_COLUMN |
_fivetran_deleted | Row deleted in the source | _sling_deleted_at IS NOT NULL, with delete_missing: soft |
_fivetran_id | Surrogate key for tables with no primary key | None. Use a real key from the source. |
_fivetran_index | Order of updates for tables with no primary key | None |
_fivetran_active, _fivetran_start, _fivetran_end | History mode versions | None. Keep history downstream. |
If you want one column for the last change, set SLING_SYNCED_AT_COLUMN=true. Sling then writes _sling_synced_at and _sling_synced_op (I, U, or D). For soft deletes, _sling_synced_at replaces _sling_deleted_at (see environment variables).
We tested the first two rows of the table on a local SQLite source and a DuckDB target, with Sling v1.6.7 and a CLI Pro token:
source: SOURCE_DB
target: WAREHOUSE
env:
SLING_LOADED_AT_COLUMN: timestamp
defaults:
mode: incremental
object: main.{stream_table}
target_options:
delete_missing: soft
streams:
main.customers:
primary_key: [customer_id]
update_key: updated_at
The first run loaded 1,000 customers. Then we changed two rows, deleted three rows, and added one row in the source. The second run:
INF getting checkpoint value (updated_at)
INF reading from source database
INF writing to target database [mode: incremental]
INF created table "main"."customers_sling_duckdb_tmp"
INF streaming data
INF inserted 3 rows into "main"."customers" in 1 secs [3 r/s] [216 B]
INF processing missing soft ID deletion for columns ["customer_id"] into table "main"."customers"
INF execution succeeded
The target table then had these columns:
| COLUMN_NAME | DATA_TYPE |
| customer_id | BIGINT |
| name | VARCHAR |
| plan | VARCHAR |
| updated_at | VARCHAR |
| _sling_loaded_at | TIMESTAMP WITH TIME ZONE |
| _sling_deleted_at | TIMESTAMP WITH TIME ZONE |
It had 1,001 rows, 1,001 distinct customer_id values, and 3 rows with a value in _sling_deleted_at. A dbt filter where not _fivetran_deleted becomes where _sling_deleted_at is null.
How do you verify the cutover?
Compare the totals and the distinct key counts. These queries find a primary key that did not carry over:
SELECT
(SELECT count(*) FROM demo_fivetran_migration.customers) AS customers_total,
(SELECT count(*) FROM demo_fivetran_migration.orders) AS orders_total,
(SELECT count(DISTINCT order_id) FROM demo_fivetran_migration.orders) AS orders_distinct;
CUSTOMERS_TOTAL ORDERS_TOTAL ORDERS_DISTINCT
20000 87500 87500
Customers is 20,000, not 20,002, because the two changed rows merged into their rows. Orders is 85,000 plus 2,500. orders_distinct is equal to orders_total, so no order_id is a duplicate. If the primary key had not carried over, the second run would append rows and the distinct count would be smaller than the total.
To see the merge, run with --debug. Sling shows the SQL that it sends to Snowflake (shortened here):
MERGE INTO "DEMO_FIVETRAN_MIGRATION"."CUSTOMERS" tgt
USING (SELECT ... FROM "DEMO_FIVETRAN_MIGRATION"."CUSTOMERS_TMP") src
ON (src."CUSTOMER_ID" = tgt."CUSTOMER_ID")
WHEN MATCHED THEN UPDATE SET ...
WHEN NOT MATCHED THEN INSERT (...) VALUES (...)
The primary_key becomes the ON clause. To compare a full table, query the Fivetran schema and the Sling schema with the same SQL for some days. For more about merges and composite keys, see upserts with Sling.
What are the cutover steps?
- Select one connection. Start with a database connection that has a high MAR count or many failed syncs.
- Export the configuration with
GET /v1/connections/{connectionId}or from Terraform. - Write the replication file with the mode table above. Look for tables with no primary key that use
_fivetran_id. - Run Sling into a separate schema. Do not write to the tables that Fivetran owns.
- Compare for some days. Compare the totals, the minimum and maximum of the cursor column, and the distinct key count.
- Change the downstream models to the new schema and the
_sling_columns. - Pause the Fivetran connection. A paused connection does not sync, and its destination tables stay. Delete it when you are sure that you do not need to go back.
- Schedule Sling. Use cron, a CI runner, a Kubernetes CronJob, or the Sling Platform.
Fivetran bills each connection on Monthly Active Rows: “the number of distinct rows synced from the source system to your destination system in a given calendar month.” Inserts, updates, and deletes count. Each connection with 1 to 1M MAR also has a $5 base charge. Sling CLI Pro and the Sling Platform have a flat monthly price with no row metering. The cost comparison has the numbers.
When should you keep Fivetran?
Do not move every connection. Fivetran is the better choice in these cases:
- Many SaaS API sources. Fivetran says that it has more than 700 managed connectors. Sling has 40+ databases and file systems, plus API specs that you define in YAML. If most of your connections are SaaS tools, the work to replace them can cost more than the MAR.
- No team to run a scheduler. Fivetran runs the syncs in its service. With the Sling CLI, you run the binary and its schedule. The Sling Platform adds a UI and a scheduler, but your agent still runs in your infrastructure.
- History mode in the destination. If your models read
_fivetran_startand_fivetran_end, you must build that history again downstream before you move. - Configuration by people who do not write code. A Fivetran connection is set in a browser. A Sling replication is a YAML file, usually in a Git repository.
Related guides
- Sling vs Fivetran to compare the two tools
- Sling vs Fivetran cost for a MAR cost model that you can run again
- Migrating from Airbyte to Sling for the same steps from Airbyte
- Export PostgreSQL to Snowflake for more about this connection pair
Frequently asked questions
How long does it take to move one Fivetran connection to Sling?
The YAML for one database connection takes minutes to write: a table list, a sync mode, and a primary key for each table. Most of the time goes into the parallel run, where Fivetran and Sling write to two schemas for some days before you change the downstream models.
Does Sling write the _fivetran_synced and _fivetran_deleted columns?
No. Sling has its own optional columns. SLING_LOADED_AT_COLUMN adds _sling_loaded_at, and the delete_missing: soft target option adds _sling_deleted_at. Change the downstream filters from the _fivetran_ names to the _sling_ names before you cut over.
What is the Sling equivalent of Fivetran soft delete mode?
Use mode: incremental with a primary_key and an update_key, plus the target option delete_missing: soft. Sling merges changed rows and sets _sling_deleted_at on rows that are not in the source. delete_missing is a CLI Pro feature.
Can Sling keep history like Fivetran history mode?
Not in the same table. Sling does not write _fivetran_start and _fivetran_end style versions. Keep history downstream, for example with a dbt snapshot on the table that Sling loads.
Do I have to migrate every connection at once?
No. Fivetran and Sling can write to the same warehouse in different schemas at the same time. Move one connection, compare the results, then move the next one.

