Learn

How to copy a production database to dev without the sensitive data

Mask a snapshot in the production account first, then share only the masked copy with the dev account. Unmasked data never leaves the production account, and nobody in dev needs access to production.

What happens in each account

Source account (production)

  1. Snapshot

    The latest snapshot is copied.

  2. Check schema

    The run stops if there are new columns.

  3. Mask

    Washery applies the policy you approved.

  4. Verify

    The run stops if the check finds sensitive data.

Destination account (dev or test)

Masked copy

A snapshot, a database or backup files in your dev or test account.

Why not copy the snapshot to dev and mask it there?

If you copy the snapshot first, the unmasked data is in the dev account, and everyone who can restore a snapshot in that account can read it. Mask the data in the production account, so that only masked data reaches dev.

What has to be set up between the two accounts?

Amazon RDS lets you share a snapshot with another AWS account. Three rules apply:

  • A snapshot encrypted with the default aws/rds key cannot be shared. The masked snapshot has to be copied with a customer managed key that the dev account is allowed to use.
  • The dev account copies the shared snapshot with a key that belongs to it, and restores from that copy.
  • SQL Server and Oracle snapshots encrypted with Transparent Data Encryption cannot be shared.

The four ways a masked copy can appear in dev

How the masked copy appears in dev depends on what your team does with it.

  • Shared snapshot. A masked snapshot is shared with your dev or test account. Restore it for a branch, a bug or a load test.
  • Database, restored alongside. A new masked database appears next to the one you already have, so work in progress carries on.
  • Database, replaced. Your dev or test database is replaced on the same endpoint, so apps and connection strings keep working.
  • Backup files. Masked backup files land in an S3 bucket in your dev or test account. Developers can load a copy on their machine, where your data-handling policy allows.

How do you keep the dev copy fresh?

Run the copy on a schedule, every night or every week, and check the schema before every run. If a column was added to production after the masking policy was approved, it has no mask. The run has to stop until a person decides how to mask it.

How do you protect production while this runs?

Use snapshots only, and do not give the copy job permission to change a production database. A copy job that has production credentials, or can change the live database, adds more risk than it removes.

How Washery does it

Washery uses snapshots only. Running Washery does not impact your live database.

The Washery role is denied any change to any production database. One CloudFormation stack in each account creates the role, and the app shows what the role can do.

The AWS accounts page in Washery listing what the Washery role can do, ending with a line saying it cannot touch live databases
What the Washery role can do in your accounts, as the app shows it.

You link the production account to its dev and test accounts. A masked copy can only go to an account the production account names. Link a destination AWS account shows the steps.

You choose how the masked copy appears in dev.

The Output step of New masked copy, offering a shared snapshot, a database restored alongside, a replaced database or backup files
The four ways a masked copy can appear in the dev account.

When a run finishes, the masked copy is in the dev account. Washery re-encrypts the masked snapshot with a delivery key that only the destination accounts can use, shares it, and removes everything else the run created. Runs can be scheduled, or started and followed through the API.

The Output panel of a finished run, showing the masked snapshot shared with the dev account and the steps and command to restore it
A finished run: the masked snapshot is shared with the dev account, with the steps to restore it.

When is this not the right approach?

  • You need every change replicated to dev continuously. AWS DMS does that and Washery does not.
  • You need a few tables or a subset of the data. Washery copies a whole RDS instance or Aurora cluster.

Source, checked 2 December 2026: Sharing encrypted snapshots for Amazon RDS.

Related

Mask your first database today

Connect your account, review what Washery will mask, and pay only when you create the masked copy.

Want to talk it through first? Book a 20-minute demo.

Mask your first database