richardhj / privacy-dump-bundle
A symfony bundle to create anonymized database dumps
Installs: 2 268
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Type:bundle
Requires
- php: >=7.1
- richardhj/privacy-dump: dev-main
- symfony/config: ^4.4. || ^5.0
- symfony/console: ^4.4 || ^5.0
- symfony/dependency-injection: ^4.4 || ^5.0
- symfony/http-kernel: ^4.4 || ^5.0
- symfony/yaml: ^4.4 || ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
This package is auto-updated.
Last update: 2024-10-29 05:41:19 UTC
README
Create purged and anonymized MySQL database dumps
About
This Symfony bundle provides utilities for creating anonymized database dumps.
It is the equivalent of mysqldump
, with additional features, at the cost of performance (PHP implementation).
The main purpose of this tool is to create anonymized dumps, in order to comply with GDPR regulations.
This Symfony bundle complements https://github.com/richardhj/privacy-dump/.
Features
- Data converters (transform the data before it is dumped to the file)
- Table filtering
- Tables include list (only these tables will be included in the dump)
- Tables exclude list (not included in the dump)
Installation
composer require richardhj/privacy-dump-bundle
Configuration
richardhj_privacy_dump: database: prod: # <- the name of the database host: localhost port: 3306 user: root password: password database: test # If DSN is specified, it will override other values dsn: 'mysql://root:root_pass@127.0.0.1:3306/test_db' # DSN can be an environment variable dsn: '%env(DATABASE_URL)%' config: default: # <- the name of the export configuration tables: log: truncate: true user: converters: firstname: converter: 'anonymizeText' lastname: converter: 'anonymizeText' street: converter: 'anonymizeText' company: converter: 'anonymizeText' email: converter: 'randomizeEmail' cache_key: 'member_email' unique: true username: converter: 'randomizeEmail' cache_key: 'member_email' unique: true secret: converter: 'setNull'
Full documentation of available converters:
https://github.com/Smile-SA/gdpr-dump/blob/master/docs/01-configuration.md#dump-settings
Usage
php bin/console privacy-dump prod default --filename dump.sql