PostgreSQL PII Anonymizer & Sanitized Backups

Production data for dev and staging, without the personal data. Cloud-DB-Anonymizer exports your PostgreSQL database, replaces every email, name, phone number, credit card and IBAN with realistic fake data, and gives you a clean SQL dump you can restore anywhere. Joins and foreign keys keep working.

⬇ Download the free CLI · See Pro & Agency →

How it works

  1. List the columns that hold personal data in a small rules.json file (for example users.email → email, payments.card_number → credit_card).
  2. Run python main.py sanitize --db-url $DATABASE_URL --rules rules.json.
  3. Restore the result into staging with gunzip -c sanitized_*.sql.gz | psql $STAGING_DATABASE_URL.
Column Production Sanitized
email jane.doe@acme.com antoniomacdonald.faa812c4@example.com
name Jane Doe Maria Harmon
phone +212 600-111222 +1-555-726-7654
credit card 4111 1111 1111 1111 4756410247684656 (Luhn-valid)
IBAN GB82WEST12345698765432 GB17NPNE05766470207453

Built for real databases

  • Deterministic fakes — values are derived from an HMAC-SHA256 keyed with your secret salt, so the same real value becomes the same fake one in every table. Foreign keys, joins and unique indexes survive.
  • Restorable dumps — schema via pg_dump, data in foreign-key order, sequences reset, identity and JSONB columns, arrays.
  • Read-only and consistent — one REPEATABLE READ, READ ONLY transaction; huge tables are streamed at constant memory.
  • Subset and exclude — filter rows with WHERE clauses, drop tables, or keep only the schema of log tables.
  • 20 strategies — email, name, first_name, last_name, username, phone, credit_card, iban, ssn, address, city, postcode, company, ip, url, text, date_of_birth, hash, redact, null.

Pricing

Free CLI Pro Suite Agency License
Price (one-time) Free 289 MAD (≈ US$29) 779 MAD (≈ US$79)
PII anonymization, 20 strategies ✓ ✓ ✓
Restorable gzip SQL dumps ✓ ✓ ✓
Upload to one S3-compatible bucket ✓ ✓ ✓
Parallel sync to AWS S3 + Cloudflare R2 + DigitalOcean Spaces — ✓ ✓
Cron scheduler + retention pruning — ✓ ✓
Web dashboard (Next.js + Tailwind) — ✓ ✓
Telegram and Discord alerts — ✓ ✓
Docker Compose deploy — ✓ ✓
Client deployments + rebranding — — ✓
Download Buy Pro Buy Agency

Checkout is in Moroccan dirham; your card converts automatically. Instant download, full source code, free 1.x updates. The Pro Suite is self-hosted: your data and cloud keys never leave your infrastructure.

Guides

Source code: github.com/fadadyounes-pixel/cloud-db-anonymizer

FAQ

Does it write to my production database?
No. It only runs SELECT statements inside a read-only transaction. A read-only database user is enough.

Which PostgreSQL hosts work?
PostgreSQL 12 and newer: Amazon RDS and Aurora, Google Cloud SQL, Supabase, Neon, DigitalOcean and self-hosted.

Can the fake data be reversed?
Not without your salt. Rotate the salt to generate a completely new data set.

Is it GDPR compliant?
It helps with data minimization by keeping real personal data out of non-production systems. Compliance also depends on your rules covering every PII column, so review them when your schema changes.