Skip to content

Production Data Sync

The Sync medium copies data from one environment to another with built-in PII anonymization. Debug with realistic data without exposing personal information.

Terminal window
# Sync with anonymization
confiture sync --from production --to local --anonymize
✓ Syncing production → local
→ Anonymizing PII columns...
→ tb_user: 12,450 rows (6,500 rows/sec with anonymization)
→ tb_post: 45,230 rows (70,000 rows/sec)
→ tb_comment: 128,900 rows (70,000 rows/sec)
✓ Sync complete in 4.2s
Terminal window
# Full sync with anonymization
confiture sync --from production --to local --anonymize
# Sync specific tables only
confiture sync --from production --to staging --tables users,posts
# Sync without anonymization (staging to staging)
confiture sync --from staging --to local
# Resume an interrupted sync
confiture sync --resume --checkpoint sync.json
# Dry run — show what would be synced
confiture sync --from production --to local --anonymize --dry-run

Configure anonymization rules in confiture.yaml:

confiture.yaml
sync:
anonymize:
tb_user:
email: email # alice@example.com → user_a1b2c3@example.com
name: name # Alice Johnson → User A1B2
phone: phone # +1-555-1234 → +1-555-4567
bio: redact # Any value → [REDACTED]
password_hash: hash # Consistent hash for testing
tb_payment:
card_number: redact
billing_address: redact
StrategyInputOutputUse Case
emailalice@example.comuser_a1b2c3@example.comEmail fields
nameAlice JohnsonUser A1B2Name fields
phone+1-555-1234+1-555-4567Phone numbers
redactAny value[REDACTED]Sensitive text, addresses
hashAny valueConsistent hashPasswords, tokens (preserves uniqueness)
  • Deterministic — the same input always produces the same output (useful for foreign key consistency)
  • Non-reversible — you cannot recover the original data from the anonymized version
  • Format-preserving — emails look like emails, phones look like phones
ModeThroughputUse Case
Without anonymization~70,000 rows/secStaging-to-staging, non-sensitive data
With anonymization~6,500 rows/secProduction-to-local, PII data

For large syncs (millions of rows), use checkpoints to resume if interrupted:

Terminal window
# Start sync with checkpoint file
confiture sync --from production --to local --anonymize --checkpoint sync.json
# Resume if interrupted
confiture sync --resume --checkpoint sync.json