Skip to content

sanitize

Run the sanitization pipeline on a database snapshot.

clonit sanitize <target> [snapshot_index]
Argument Description Required
target Name of the target Yes
snapshot_index Index of the snapshot to sanitize No (defaults to latest)

Executes a three-step sanitization pipeline on the specified snapshot:

  1. Restore: The source snapshot is restored into the sanitize destination database (sanitize_dst_url).
  2. Execute: The sanitization SQL query file (sanitize_query_file) is executed against the sanitize destination database to scrub, mask, or transform sensitive data.
  3. Dump: The sanitized database is dumped to create a new sanitized snapshot.

The target must have both sanitize_dst_url and sanitize_query_file configured. Use targets add or targets update to set these fields.

Sanitize the latest snapshot:

clonit sanitize mydb

Sanitize a specific snapshot by index:

clonit sanitize mydb 0
  • build – Create a snapshot of the source database
  • load – Load a snapshot into the destination database
  • snapshots – List snapshots for a target