← Digital Shop guides

Why You Shouldn't Copy Production Data Into Test Environments (and What to Use Instead)

The risks of using real customer data in development and testing, the main alternatives (masking, subsetting, synthetic data), and reserved domains, phone numbers and IP ranges that are safe to put in test data.

Copying the production database into a dev or staging environment is fast and gives realistic data. It is also one of the most common ways personal data leaks. This guide covers why it's risky, what the alternatives are, and a few reserved values that make test data safe by design.

Why production copies are risky

The alternatives

ApproachWhat it isGood forWatch out for
Masking / anonymizingReplace names, emails etc. in a copy of productionKeeping real-world distributionsRe-identification from what's left (rare values, free-text fields, combinations of fields)
SubsettingTake a small, masked slice of productionSmaller, faster test databasesBroken foreign keys if the slice isn't consistent
Synthetic dataGenerate data that never belonged to anyoneDemos, CI, tutorials, sharing with vendorsMust be consistent and realistic enough to catch real bugs

For most development, demos and automated tests, synthetic data is the simplest choice because there is no personal data to protect in the first place.

What makes synthetic data useful

Random strings in every column aren't enough. Useful test data:

Reserved values that are safe to use

These are set aside by standards bodies precisely so they can't reach a real person or system:

A quick checklist

  1. No real names, emails, phone numbers, addresses, government IDs or card numbers in non-production environments.
  2. Outgoing email, SMS and webhooks disabled or pointed at a sandbox in test environments.
  3. Seed data versioned in the repo and generated from a fixed seed, so every run is reproducible.
  4. Consistency checks (sums, foreign keys, date order) run against the seed data in CI.
  5. If you must use masked production data, document who approved it, where it lives and when it gets deleted.

Related in the shop

Customers, products, orders, payments, shipments and returns that add up: a realistic, fully synthetic e-commerce database for dev, demos and SQL practice.

$19 one-time plus applicable tax

Employees, managers, salary history, benefits, pay periods, payslips, time off and reviews that add up: a fully synthetic HR database for dev, demos and SQL practice.

$19 one-time plus applicable tax

Shipments, packages, carriers, service levels and tracking events that add up: a fully synthetic shipping database for dev, demos, dashboards and SQL practice.

$19 one-time plus applicable tax

Sold by Quietcog. Support: gb1@mail.grokbot.com. General information only, not professional advice.