Can I Switch My Incremental Sync Method From Fivetran Teleport Sync to CT or CDC?
Question
Can I change my connection's incremental sync method from Fivetran Teleport Sync to change tracking (CT) or change data capture (CDC)?
Environment
Connector: SQL Server
Answer
Yes, you can change your SQL Server connection's incremental sync method from Fivetran Teleport Sync to CT or CDC in Fivetran. However, this change triggers a historical sync of all tables so that we can start from a clean CDC cursor.
To change the incremental sync method:
- Make sure CT or CDC is enabled on your SQL Server database and tables. For more information, see Change tracking and Change data capture.
- In Fivetran, go to your SQL Server connection page.
- Select the Settings tab.
- Click Edit connection.
- In the Replication Method drop-down menu, select Read changes using CT or CDC mechanisms.
- Click Save & Test.
Fivetran validates that CT or CDC is enabled and that it can read the changes. When the historical sync finishes, we read from the CT or CDC change data during incremental syncs. For each table, we use CDC if it's enabled and CT otherwise.
Switch to CT or CDC using the REST API
To change the incremental sync method using the Fivetran REST API:
Enable CT or CDC on the database and on each table you want to sync. Tables that have neither enabled appear in your schema but are disabled, so you can't select them to sync.
Send a
PATCHrequest to the Update a Connection endpoint, settingupdate_methodtoNATIVE_UPDATE:PATCH https://api.fivetran.com/v1/connections/<connectionId> Content-Type: application/json { "config": { "update_method": "NATIVE_UPDATE" } }Replace
<connectionId>with your connection ID. For more information about authenticating requests, see Authentication.
NATIVE_UPDATE selects the same method as Read changes using CT or CDC mechanisms in the connection setup form. For each table, Fivetran uses CDC if it's enabled and CT otherwise.
As with the UI method, this change triggers a historical sync of all tables.
Does changing the update method affect my destination schema?
No, table and column names don't change. Fivetran system columns, such as _fivetran_synced and _fivetran_deleted, are already present from when you initially set up the connection.
We don't create duplicate rows during the historical sync because we use upsert semantics in the destination. Existing rows are matched by primary key, or by _fivetran_id for tables without a primary key, and overwritten.