Upgrading from 1.x to v2
v2 rebuilds mysql-bkup on a shared streaming core: dump, compression, encryption and upload run in one pipe, without temporary files, whatever the size of the database. Existing commands, flags and environment variables keep working.
Everything that worked in 1.x keeps working; a few behaviours changed on purpose.
- Image: Debian 13 slim instead of Alpine, with Oracle’s
mysqldumpfor MySQL servers (correct MySQL 8 dumps) andmariadb-dumpfor MariaDB./bin/sh,/backup,/config, thebackup/restore/migrateshortcuts and thebkupalias are still there;tiniis now PID 1. - Renamed variables are still read, with a deprecation warning:
S3_ENDPOINT→AWS_S3_ENDPOINT,BUCKET_NAME/AWS_BUCKET_NAME→AWS_S3_BUCKET_NAME,ACCESS_KEY/SECRET_KEY→AWS_ACCESS_KEY/AWS_SECRET_KEY,AWS_S3_PATH/S3_PATH→REMOTE_PATH,FTP_HOST_NAME→FTP_HOST,BACKUP_TMP_DIR→TMP_DIR. DB_USERis the database user variable (alsoTARGET_DB_USER).DB_USERNAMEandTARGET_DB_USERNAMEare still read without a warning, including the per-database forms (DB_USERNAME_<NAME>,<NAME>_DB_USERNAME).DB_SSL_MODEtakes MySQL’s mode names;0/1still work.STORAGEandSTORAGE_PATHenv are honoured (1.x always used the--storagedefault and/backup). Unknown storage names are an error instead of a silent local backup.- SFTP variables are renamed, and the old names are no longer read:
SSH_HOST/SSH_HOST_NAME→SFTP_HOST,SSH_PORT→SFTP_PORT,SSH_USER→SFTP_USER,SSH_PASSWORD→SFTP_PASSWORD,SSH_IDENTIFY_FILE/SSH_IDENTITY_FILE→SFTP_IDENTITY_FILE,SSH_REMOTE_PATH→REMOTE_PATH. - SFTP host keys are verified by default. Set
SFTP_KNOWN_HOSTS=/path/known_hosts, orSFTP_INSECURE_IGNORE_HOST_KEY=trueto keep the 1.x behaviour. MAIL_SKIP_TLSis read with its documented meaning (trueskips certificate verification). 1.x had it inverted, soMAIL_SKIP_TLS=false(the value in.env.example) turned verification off. UseMAIL_INSECURE_SKIP_VERIFYfrom now on.- Retention only deletes indexed backups (see the configuration reference). 1.x deleted every file older than N days in the folder. Set
BACKUP_RETENTION_ADOPT_LEGACY=trueonce to let retention handle 1.x backups, orBACKUP_INDEX=falsefor name-based retention. - Encryption fails closed: a
GPG_PUBLIC_KEYthat cannot be read is an error (1.x uploaded plaintext). The env var now wins over the auto-detected/config/gnupgkey. - Errors no longer kill the daemon: a failed run is logged, notified and retried at the next schedule; other databases of the same run continue (
BACKUP_RESCUE_MODEis no longer needed). - Restore works from every storage (1.x had no SFTP restore), is case-insensitive about the storage name, and no longer goes through
sh -c. migratestreams directly into the target (no intermediate file), creates the target database if needed, andTARGET_DB_NAMEdefaults to the source name;-amigrates every database.- Notification templates are built in; custom ones still go in
/config/templates(TEMPLATES_DIR). - Version is injected with
-ldflags "-X main.Version=..."(wasutils.Version).
Checklist
- SFTP users: mount a
known_hostsfile and setSFTP_KNOWN_HOSTS, or setSFTP_INSECURE_IGNORE_HOST_KEY=true. - Email notifications with
MAIL_SKIP_TLS=false: certificate verification is now on, as the name always promised. Remove the variable, or setMAIL_INSECURE_SKIP_VERIFY=trueif your SMTP server has a self-signed certificate. - Retention: set
BACKUP_RETENTION_ADOPT_LEGACY=truefor one run if retention should also delete the backups made by 1.x. - Quoted values in Compose files: in the list syntax (
- AWS_DISABLE_SSL="false") the quotes are part of the value. v2 validates booleans and rejects"false"; write- AWS_DISABLE_SSL=false. --userruns:/backupand/tmp/backupare writable by any user (sticky, like/tmp); mounted volumes need the usual permissions.- Restoring 1.x backups: nothing to do.
.sql,.sql.gz,.sql.gpgand.sql.gz.gpgfiles from 1.x restore as before.
New in v2
- MySQL servers are dumped with Oracle
mysqldump8.4, MariaDB servers withmariadb-dump11.8 (flavour detected automatically). DB_URL(mysql://user:password@host:3306/db?ssl-mode=required), TLS modes, client certificates.- age encryption, zstd compression, Google Cloud Storage, FTPS, extra storage copies.
verify,list,delete,prune,reconcile,config,healthcommands; backup index with sha256 per backup.- Slack, Discord, ntfy, webhook and healthcheck notifications; Prometheus metrics in daemon mode.
migrate -a, and migrate without an intermediate file.