druidfi/drush-gdpr-dumper

A drop-in replacement for mysqldump that optionally sanitizes DB fields for better GDPR conformity.

Installs: 48 061

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 4

Open Issues: 1

Type:drupal-module

2.0.0 2023-06-06 07:20 UTC

This package is auto-updated.

Last update: 2024-04-02 05:55:03 UTC


README

A drop-in replacement for drush sql-dump that optionally sanitizes DB fields for better GDPR conformity.

It is based on the druidfi/gdpr-mysqldump library, and can in principle dump any database that PDO supports.

Install

Require druidfi/gdpr-mysqldump with Composer:

composer require druidfi/drush-gdpr-dumper

Enable the module in Drupal UI or with Drush:

drush en gdpr_dumper

Drush

If you want to create a sql dump on live servers for local purposes (as a developer, themer, ...), you should use following command:

drush sql-dump-gdpr > dump.sql

instead of

drush sql-dump > dump.sql

drush sql-dump-gdpr will automatically strip all GDPR related data from the sql dump to help you be GDPR compliant YO!

Configuration

In settings.php you can do the override configuration like this:

$config['gdpr_dumper.settings']['gdpr_replacements'] = [
  'users_field_data' => [ // Table
    'name' => [ // Field
      'formatter' => 'userName', // Faker formatter
    ],
  ],
];

This module can be configured by editing the gdpr_dumper.settings.yml file.

druidfi/gdpr-mysqldump contains more info about the gdpr-expressions and gdpr-replacement options.

Faker documentation lists all available formatters.

Events

The module dispatches two events:

  • GdprDumperEvents::GDPR_EXPRESSIONS
  • GdprDumperEvents::GDPR_REPLACEMENTS

This allows developers to alter the expressions and replacements through event subscribers on run-time

Happy GDPR'ing!

Forked from

This tool is a fork if robiningelbrecht/drush-gdpr-dumper.

License

This component is under the GPL2 license. See the complete license in the LICENSE file.

Other information

This project can be found from the Packagist: https://packagist.org/packages/druidfi/drush-gdpr-dumper