Tools
replibyte
replibyte is a simple tool to transfer database dumps from one host to another one(i.e. from local to the remote cloud host). It creates a repository of possible encrypted and compressed dumps by date, hence I can choose which dump to restore. This abstracts the use of native tools for postgres, mysql or mongodb (yes it also supports mongodb). An important additional feature is the option to transform sensitive data on the fly. Therefore you can configure the dump, adding transformes to the configuration that are executed and generate random content for sensitive columns like password/names/…. The roadmap even targets to recognize possible sensitive columns automatically. It also allows to subset the data, which means instead of cloning the entire database only clone a representative sample. Using the tool is very simple, doesn’t require any additional runtime configuration.
Examples(from the doc):
create a dump
replibyte -c conf.yaml dump create
restore the latest dump on remote
replibyte -c conf.yaml dump restore remote -v latest
transformer configuration, replacing a name with a random first name (from dictionary)
source:
connection_uri: $DATABASE_URL
transformers:
- database: public
table: my_table
columns:
- name: first_name
transformer_name: first-name
I haven’t used this tool myself, however I would definitively give it a try since it abstracts away the native tooling and provides a configuration-only way to obfuscate sensitive data.