PII MASKING / REFERENTIAL DATA SUBSETTING

Useful test data.
Private details, replaced.

Refresh PostgreSQL or MySQL test environments with selected rows and related records. Review masking rules column by column, then transform sensitive values in memory before writing to the target.

Choose your license
14-DAY TRIAL

Meet your next workflow.

Choose the installer for your computer.

On a Mac, check Apple menu → About This Mac for your chip.

Trial installers are not available here yet. Please check back for the download.

$10.95 monthly or $99 yearly One developer, up to two devices

The masking prismWORKFLOW STUDY
The masking prismA selected row passes through an in-memory prism: the related key stays intact and a private email becomes a synthetic value.customer_id: 10421042 / preservedprivate valuesynthetic valueIN MEMORYemail / Fakerexample.test

Synthetic example / review rules for every copied column.

Illustration / example workflow
In-memory masking · synthetic example records

1. The Database Dump Problem

When debugging a tricky production issue, developers need realistic data. However, traditional database dumps (pg_dump or mysqldump) present major compliance and engineering hazards:

  • Compliance Violations (GDPR, HIPAA, SOC 2): Copying unmasked customer emails, phone numbers, and payment details onto developer laptops exposes organizations to severe regulatory penalties.
  • Enormous File Sizes: Production databases are frequently hundreds of gigabytes or terabytes in size. Restoring an entire dump locally takes hours and wastes storage.
  • Broken Anonymization Scripts: Hand-rolled SQL scripts (e.g. UPDATE users SET email = '[email protected]') are slow, risk timeout errors, and frequently overwrite data before foreign keys are resolved.

2. Preserving Referential Integrity

Relational databases are not isolated tables—they are connected graphs of foreign keys. If you copy an order record from shop.orders without copying the corresponding record in shop.customers, the target database will immediately throw a foreign key constraint violation:

ERROR: insert or update on table "orders" violates foreign key constraint "fk_orders_customers"
DETAIL: Key (customer_id)=(10492) is not present in table "customers".

dbmigrate solves this by performing topological foreign key traversal:

  1. Filter Source Rows: You specify a target condition on the root table, such as WHERE created_at > NOW() - INTERVAL '7 days' or a list of specific Primary Key IDs.
  2. Collect Dependencies: dbmigrate queries related parent tables (such as customers) and child tables (such as order_items).
  3. Dependency-Ordered Insertion: Rows are written to the target database in strict parent-first order, in dependency order. Review cycles, constraints, and pre-existing target rows for your dataset.

3. Deterministic In-Memory Masking

Why is deterministic masking required? If a customer's email or user ID appears across multiple tables (e.g. in users, audit_logs, and notifications), random masking would replace each occurrence with a completely different random value. This breaks analytical JOINs and makes local debugging nearly impossible.

dbmigrate applies deterministic seeds and configurable salted-hash rules:

Synthetic email: "[email protected]"
Illustrative deterministic replacement: "[email protected]"

Because the salt is stored locally in your workspace, a consistent rule and seed can map repeated input values to consistent replacements. Review configuration across related columns and check the final result.

LIVE IN-MEMORY MASKING PLAYGROUND

Test Reusable Masking Rules

Experience how dbmigrate masks columns in local workstation memory before sending data over the network. Deterministic replacements maintain parent/child foreign key integrity across tables.

Local RAM Only · 0 Cloud Relays

The same seed ensures identical masked outputs across related tables (e.g. users.id and orders.user_id).

Live Transformation Preview
SOURCE (PROD)customer_email : varchar(255)
TARGET (DEV/SANDBOX)Safe for Lower Envs

Architectural Guarantee

Row values are never written to disk unencrypted, and never sent to third-party AI APIs. Masking takes place directly in volatile workstation memory through local streaming buffers before batch INSERT into your target database.

4. Step-by-Step dbmigrate Workflow

Here is how you execute a masked environment refresh in dbmigrate:

  1. Select Source & Target Connections: Choose your production or staging source and your target development database.
  2. Define Table Scope: Choose the tables you want to copy. Enable Include Related Rows to pull parent and child dependencies automatically.
  3. Apply Row Filtering: Add a WHERE condition or specify a row limit (e.g. a limit of 1,000 rows; ordering and representativeness require separate review).
  4. Review Masking Rules: dbmigrate scans column names against your Masking Dictionary (recognizing email, first_name, phone, ssn, etc.). Ensure every sensitive column has an active rule or is marked "Not PII".
  5. Execute In-Memory Copy: Rows are extracted from source, transformed in local memory, and streamed directly into target.

5. Environment Column Overrides

In addition to masking sensitive fields, certain environment flags must be forced to safe values in development. dbmigrate provides Column Overrides that apply after masking:

  • notifications_enabled = FALSE (prevents development jobs from spamming real customers).
  • payment_gateway_mode = 'sandbox' (forces sandbox payment processing).
  • auth_domain = 'localhost:3000' (redirects authentication callbacks).

6. Security Controls & Privacy Review

Use masking alongside a privacy review of the resulting dataset. Check indirect identifiers, overrides, target access, and retention rules:

Zero Cloud Ingestion

All masking transformations happen in process memory on your workstation. No external API calls are made.

Local Run History

Keep recorded SQL and run results with local history. Local run records are not a tamper-proof compliance ledger.

GUIDE QUESTIONS

Masking & subsetting FAQs.

Why is deterministic masking critical when copying relational databases?

In relational databases, customer identifiers (such as user IDs or emails) often appear across multiple tables joined by foreign keys or logical relations. If masking generated random replacements on every occurrence, foreign key constraints would break and cross-table queries would return inconsistent data. Deterministic masking uses a fixed cryptographic seed or salt so that the exact same input value always produces the exact same masked replacement across all copied tables.

Does sensitive data ever get sent to an external cloud or AI service during masking?

Never. dbmigrate performs all schema inspection, row filtering, and data transformation in-memory on your local machine using direct TCP or SSH sockets to your database servers. No row values, credentials, or schema definitions are ever sent to an external SaaS proxy or cloud AI service.

How does dbmigrate handle parent and child rows in referential data copying?

When you select rows from a table using a WHERE filter or primary-key selector, dbmigrate analyzes the foreign key graph. You can choose to include parent rows (ensuring foreign key references exist on the target) and child rows (such as copying an order and all its line items). Rows are copied in topological order: parents are inserted before children, and deleted in reverse order if replacing existing records.

What masking algorithms are supported?

dbmigrate supports Faker generators (realistic names, addresses, emails, phone numbers), salted cryptographic hashes (for pseudorandom unique identifiers), regex pattern replacements (e.g. masking social security or credit card numbers while preserving prefixes or suffixes), fixed string/numeric constants, and SQL NULL.