This package provides a framework-agnostic database backup manager 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.
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)
composer require richardhj/privacy-dump
To use in a Symfony project, use richardhj/privacy-dump-bundle
.
// 1. Define configuration
$options = [
'database' => [],
'dump' => [],
'tables_include' => [],
'tables_exclude' => [],
'tables' => [],
];
// 2. Create configuration instance
$config = new \Richardhj\PrivacyDump\Config\Config($options);
// 3. Dump
$dumper = new SqlDumper();
$dumper->dump($config, 'file.sql');
For the full options, please relate to https://github.com/Smile-SA/gdpr-dump/blob/master/docs/01-configuration.md#dump-settings.
This project is a modification of Smile-SA/gdpr-dump and thus licensed under the same GPLv3 License.
Changes made on the original package:
- Refactoring from standalone application to installable package
- Changes in configuration