TwinDB Backup
TwinDB Backup is a multipurpose tool for backing up MySQL database and regulare files/directories on the file system. It can store backup copies on a remote SSH server, Amazon S3 or Google Cloud Storage.
TwinDB Backup accepts a backup copy stream from any of supported sources (MySQL Server, Percona Server, Percona XtraDB Cluster, or file system) and redirects the stream to a series of configurable modifiers.
The modifiers can compress the stream, encrypt it, and save a copy of the stream on the local disk.
Compression options:
- gzip
- bzip2
- lbzip2
- pigz
Encryption options:
- Public/private key encryption
Because TwinDB Backup encrypts the stream itself it ensures transfer encryption as well as encryption at rest.
After the stream passed all modifiers it is sent to one of the configured backup destination. It can be:
- Amazon S3 bucket
- Google Cloud Storage bucket
- Any server with SSH demon
The tool can easily restore the backup copies. Read full documentation on https://twindb-backup.readthedocs.io.
Features
TwinDB Backup key features:
- MySQL full and incremental backups
- Zero seconds Recovery Point Objective (RPO) with MySQL binary log backups
- Percona Xtradb Cluster backups
- Files/directories backups
- Backups verification
- Backups monitoring and alerting:
- Recovery Time Objective (RTO)
- Backups heartbeat
- Backups verification heartbeat
- PCI-DSS compliant:
- Transfers encryption
- Encryption at rest
- GDPR compliant:
- Strictly enforced retention policy
TwinDB Backup storage options:
- Amazon S3
- Google Cloud Storage
- Remote SSH server
- Optional local copy
Other features:
- Retention policy defines how many hourly/daily/weekly/monthly/yearly copies to keep
- Separate retention policy for remote and local backup copies
- Email notifications
- Datadog/StatsD integration
- cron configuration comes with a package
How do I get set up?
TwinDB Backup can be installed from a DEB/RPM package.
The packages are available in the Releases.
Installing TwinDB Backup on Ubuntu
Install appropriate Percona XtraBackup version (2.4 for MySQL 5.6, 5.7 or 8.0 for MySQL 8.0).
# # Download the package
# wget https://downloads.percona.com/downloads/Percona-XtraBackup-2.4/Percona-XtraBackup-2.4.26/binary/debian/bionic/x86_64/percona-xtrabackup-24_2.4.26-1.bionic_amd64.deb
# # Install XtraBackup
# apt install ./percona-xtrabackup-24_2.4.26-1.bionic_amd64.deb
Install TwinDB Backup.
# # Download the package
# wget https://twindb-release.s3.amazonaws.com/twindb-backup/3.0.0/bionic/twindb-backup_3.0.0-1_amd64.deb
# # Install TwinDB Backup
# apt install ./twindb-backup_3.0.0-1_amd64.deb
Installing TwinDB Backup on CentOS
Install appropriate Percona XtraBackup version (2.4 for MySQL 5.6, 5.7 or 8.0 for MySQL 8.0).
# yum install https://downloads.percona.com/downloads/Percona-XtraBackup-2.4/Percona-XtraBackup-2.4.26/binary/redhat/7/x86_64/percona-xtrabackup-24-2.4.26-1.el7.x86_64.rpm
Install TwinDB Backup.
# yum install https://twindb-release.s3.amazonaws.com/twindb-backup/3.0.0/7/twindb-backup-3.0.0-1.x86_64.rpm
Configuring TwinDB Backup
TwinDB Backup is configured in /etc/twindb/twindb-backup.cfg
. See :ref:`usage` for details.
How to build TwinDB Backup manually
The TwinDB Backup package can build on a machine with Docker service.
make package
will build the package for the operating system defined in the OS_VERSION
environment variable.
Possible OS_VERSION
values:
- 7
- bionic
- focal.
# export OS_VERSION=bionic
# make package
The package file will be generated in omnibus/pkg/
:
$ ls omnibus/pkg/*.deb
omnibus/pkg/twindb-backup_2.20.0-1_amd64.deb
Once the package is built you can install it with rpm/dpkg or upload it to your repository and install it with apt or yum.
Configuration
Configuration is stored in /etc/twindb/twindb-backup.cfg
.
See https://twindb-backup.readthedocs.io/ for more details.
Credits
- This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
- TwinDB Backup uses Percona Xtrabackup for MySQL backups.
- Contributors (in alphabetical order):
TwinDB Backup uses Percona Xtrabackup for MySQL backups.