/drt:drt-migratefrom drt
Helps migrate Reverse ETL syncs from Census, Hightouch, Polytomic, or custom scripts to drt. Maps concepts, generates sync YAML, and guides safe dry-run validation.
Ships in drt. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Help the user migrate from an existing Reverse ETL tool (Census, Hightouch, Polytomic, or custom scripts) to drt.
Ask the user to share their existing sync configuration (screenshot, YAML, JSON, or description).
If they do not have a drt project yet, scaffold one first — the syncs need a project and a profile to live in:
mkdir my-drt-project && cd my-drt-project
drt init # interactive: project name, source type, connection fields
drt profile test <name> # prove the warehouse credential works before migrating anything
Use the /drt-init skill if they want to be walked through it.
Map their existing config to drt equivalents using the tables below.
Generate a valid syncs/<name>.yml for each sync.
Note any features that need manual setup (auth env vars, profiles.yml).
Run the first migrated sync as a preview, not a send. This is the step
that matters most in a migration: the old tool is still running, the
destination has live records, and a mismapped sync.mode or upsert_key
writes to production on the first invocation.
drt validate # catches schema errors and hardcoded secrets
drt run --select <name> --dry-run # no data written
drt run --select <name> --dry-run --diff # record-level preview on queryable destinations
drt run --select <name> --limit 10 # first real send, capped at 10 rows
Only after the diff looks right should they run it uncapped. Flag explicitly
that mode: mirror and replace delete or truncate destination rows, and
that --limit is refused for both — so those two modes go straight from
--dry-run --diff to a full run, with no sampled middle step. For
snapshot-diff incremental, --limit is allowed in upsert mode but never
promotes the full snapshot baseline.
| Census / Hightouch concept | drt equivalent |
|---|---|
| Source (BigQuery model) | model: ref('table') or raw SQL |
| Destination connection | destination.type + auth config |
| Sync behavior: Full | sync.mode: full (every run, no dedup) |
| Sync behavior: Append (incremental) | Cursor: sync.mode: incremental + cursor_field. No reliable cursor on a Postgres/Snowflake/Databricks/BigQuery source: mode: upsert + incremental_strategy: diff + destination upsert_key (source snapshots in managed_schema). |
| Sync behavior: Mirror (upsert + delete-removed) | sync.mode: mirror + upsert_key — Postgres / MySQL / ClickHouse / Snowflake / Databricks / BigQuery. strategy: destination compares with the target; tracked protects co-written rows and combines with scope on all except BigQuery; diff deletes exact removals produced by incremental_strategy: diff on all six and rejects scope. |
| Sync behavior: Replace (overwrite table) | sync.mode: replace (TRUNCATE + INSERT, zero-downtime via replace_strategy: swap on supported DWHs) |
| Field mappings (rename columns) | sync.field_mappings: {source_column: destination_field} (v0.7.9, #415) — first-class column rename applied just before the destination; use instead of aliasing in SQL |
| Field mappings (compute / reshape a value) | sync.computed_fields: {name: "<jinja>"} (#763) — derived columns for every destination, applied before field_mappings / mask; a single-expression template keeps the value's Python type. body_template / properties_template remain for shaping the whole payload of the destinations that have them |
| PII masking on a synced column | sync.mask: {field: hash | redact} or {field: {strategy: truncate, length: N}} (v0.7.10, #427/#660) — obscures a field just before the destination without touching the source SQL |
| Run schedule | drt run via cron, CI, Dagster, Airflow, or Prefect |
| Error notifications | failure_alerts (Slack / webhook, v0.7.0+) — fires on sync-level failures |
| Per-row error policy | on_error: skip (continue past failures) vs on_error: fail (stop at first) |
sync.mode matches the source semantic)| User wants | drt mode | Notes |
|---|---|---|
| "Re-send everything every run" | full | Default. Idempotent destinations only — REST API / Slack / file outputs. |
| "Append new rows since last run" | incremental + cursor_field | Watermark-based. --cursor-value overrides for backfill. |
| "Send added/changed rows without a cursor" | upsert + incremental_strategy: diff + upsert_key | Postgres/Snowflake/Databricks/BigQuery sources. Needs writable managed_schema; same-sync runs must not overlap; --limit never advances the baseline. |
| "Upsert by key" | upsert + upsert_key | Census's most common "Update" shape. |
| "Upsert by key AND delete rows removed from source" | mirror + upsert_key | Census's "Full Sync with Deletion" / Hightouch's "Mirror" semantic. All six SQL warehouse destinations. Use tracked for co-written tables (not BigQuery), or pair source diff with mirror.strategy: diff for exact removal keys. |
| "Overwrite the destination table each run" | replace | Full rebuild on all six SQL warehouse destinations. replace_strategy: swap uses an atomic shadow-table cutover, including BigQuery copy jobs. |
| Old tool style | drt equivalent |
|---|---|
| Stored API key in UI | token_env: MY_TOKEN + export MY_TOKEN=... (never hardcode — drt validate flags hardcoded secrets) |
| OAuth app | Use token from OAuth flow → token_env |
| Service account JSON | Set GOOGLE_APPLICATION_CREDENTIALS for BigQuery source |
| Connection string | Source profile field in ~/.drt/profiles.yml (env-var-substituted via ${VAR}) |
| Managed state/history in the old service | state.backend: warehouse + connection_profile; Postgres/Snowflake/Databricks/BigQuery persist run state, history, and DLQ under the profile's managed_schema |
| Cloud secret reference | Put an aws-sm://, gcp-sm://, or vault:// URI in the relevant *_env field; install the matching extra |
For each sync, output:
# syncs/<name>.yml
name: <name>
description: "Migrated from <tool>"
model: ref('<table>') # or raw SQL
destination:
type: <type>
# ... fields
sync:
mode: full # or incremental / upsert / mirror / replace
# ...
Then summarize:
~/.drt/profiles.yml)mirror is the same shape; Census "Full Sync without Deletion" → drt full keeps stale rows in the destination, so the user may want upsert instead)docs/llm/API_REFERENCE.md — all destination types and fieldsdocs/connectors/ — per-destination details (auth, supported modes)examples/postgres_to_postgres_mirror/ — runnable example for the mirror mode shapeWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub drt-hub/drt --plugin drt6 skills in this plugin
/drt-create-syncGenerate a drt sync YAML configuration file. Use this skill whenever a user wants to create a new drt sync, connect a data warehouse table to an external service, or set up a Reverse ETL pipeline with drt.
/drt-debugDebug and fix a failing drt sync. Use this skill whenever a user reports errors running drt, asks why a sync is failing, or needs to diagnose drt configuration problems (auth errors, rate limits, template errors, etc.).
/drt-initGuide a user through initializing a new drt project. Use this skill when a user is setting up drt for the first time, asks how to get started with drt, or needs help configuring their data warehouse connection.
/drt-review-syncReview what a drt sync is about to change and apply it only after a human approves. Use this skill whenever a user asks to preview, review, approve or safely apply a sync, especially one that deletes rows (mirror/replace), updates many records, or writes to a production CRM. Uses drt_plan / drt_apply (MCP) or `drt plan` / `drt apply` (CLI).
/drt-troubleshootWalk a drt setup through a full top-to-bottom diagnostic checklist when something is off but the failing layer isn't obvious. Use this when a user says "drt isn't working", a sync silently does nothing, results look wrong, or they want to verify a fresh setup end-to-end — broader than /drt-debug, which fixes a specific known error.
Other plugins' skills for the same job