Skip to content

Add sanitised database dump tool to drupal websites. #573

@thomaslobjoie

Description

@thomaslobjoie

To enable websites to perform sanitised database dump, we need to install a tool such as mtk_dump. It provides a Go binary file that can perform dumps following a ruleset stored in a Yaml file. We will need that tool on every drupal websites, so it makes sense to make it available by default in the binary folder.

A default ruleset Yaml file and a default bash script could also be added to the project skeleton.

Binary download page: https://github.com/skpr/mtk/releases

I installed it manually, for test purpose, to the binary folder and ran the following:

./bin/mtk-dump \
--config=/tools/dump/mtk-dump.yml \
--host=$DB_HOST \
--user=$DB_USER \
--password=$DB_PASS \
$DB_NAME > /app/tools/assets/dump.sql

This test provides exactly the excepted result.

Example of a ruleset:

---
rewrite:
  users_field_data:
    mail: concat(uid, "@localhost")
    pass: '"password"'

nodata:
  - cache*
  - captcha_sessions
  - history
  - flood
  - batch
  - queue
  - sessions
  - semaphore
  - search_api_task
  - search_dataset
  - search_index
  - search_total

ignore:
  - __ACQUIA_MONITORING__

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions