← Back to Features

SQL Dump Anonymizer

Sanitize database exports while preserving SQL structure

LogScrub processes SQL dump files from PostgreSQL, MySQL, SQLite, and other databases. It detects PII in INSERT statements, string literals, and comments—anonymizing sensitive data while keeping your SQL syntax valid and executable.

Screenshot placeholder: SQL dump in editor with highlighted PII in INSERT statements

Before & After Examples

User Table Export

Before Anonymization
INSERT INTO users (id, email, name, phone, ip_address, ssn) VALUES
(1, 'john.smith@email.com', 'John Smith', '+1-555-123-4567', '192.168.1.100', '123-45-6789'),
(2, 'jane.doe@company.org', 'Jane Doe', '+1-555-987-6543', '10.0.0.55', '987-65-4321'),
(3, 'bob.w@example.net', 'Bob Wilson', '+44 20 7123 4567', '172.16.0.10', '456-78-9012');
After Anonymization
INSERT INTO users (id, email, name, phone, ip_address, ssn) VALUES
(1, '[EMAIL-1]', '[NAME-1]', '[PHONE-1]', '[IPV4-1]', '[SSN-1]'),
(2, '[EMAIL-2]', '[NAME-2]', '[PHONE-2]', '[IPV4-2]', '[SSN-2]'),
(3, '[EMAIL-3]', '[NAME-3]', '[PHONE-3]', '[IPV4-3]', '[SSN-3]');

Transaction Log Table

Financial Data in SQL
Before:
INSERT INTO transactions
  (card_number, amount, iban)
VALUES
  ('4111-1111-1111-1111', 99.99,
   'GB82WEST12345698765432'),
  ('5500-0000-0000-0004', 45.50,
   'DE89370400440532013000');
After:
INSERT INTO transactions
  (card_number, amount, iban)
VALUES
  ('[CC-1]', 99.99,
   '[IBAN-1]'),
  ('[CC-2]', 45.50,
   '[IBAN-2]');

Supported SQL Syntax

PII Types Detected

Key Features

SQL Structure Preservation

LogScrub only modifies string literals and values—table names, column names, SQL keywords, and syntax remain untouched. Your anonymized dump stays valid and executable.

Consistency Mode

When the same email appears in multiple INSERT statements, it gets the same replacement throughout the file. This preserves referential integrity in your data.

Foreign Key Relationships Preserved
Before:
INSERT INTO users (id, email)
VALUES (1, 'john@corp.com');

INSERT INTO orders (user_email)
VALUES ('john@corp.com');

INSERT INTO logs (email)
VALUES ('john@corp.com');
After:
INSERT INTO users (id, email)
VALUES (1, '[EMAIL-1]');

INSERT INTO orders (user_email)
VALUES ('[EMAIL-1]');

INSERT INTO logs (email)
VALUES ('[EMAIL-1]');

Realistic Replacement Option

Choose the "Realistic" replacement strategy to generate plausible fake data instead of labels:

Realistic Fake Data
-- Original
INSERT INTO users VALUES ('john.smith@email.com', '192.168.1.100');

-- With Labels
INSERT INTO users VALUES ('[EMAIL-1]', '[IPV4-1]');

-- With Realistic Data
INSERT INTO users VALUES ('sarah.jones@example.net', '203.0.113.42');

Use Cases

Output Options

Ready to anonymize your SQL dumps?

Drop your .sql file into LogScrub to get started.

Launch LogScrub