Sign inSign up

doalitic/mysqlbackups

By doalitic

•Updated over 8 years ago

Docker MySQL Backups Image

Image
0

1.2K

doalitic/mysqlbackups repository overview

⁠Restore mysql backup

⁠Copy and decompress full backup from GCS to backup container

mkdir /tmp/restore
cd /tmp/restore
gsutil cp gs://gcsbucket/yYYYYwWW-complete.tar.bz2 .
tar xvf yYYYYwWW-complete.tar.bz2

⁠Option A: Restore full backup

⁠Prepare full backup

Instructions:

innobackupex --apply-log /tmp/restore/backups/binary/yYYYYwWW-complete/

⁠Option B: Restore full + incremental backup

⁠Copy and decompress incremental backup from GCS to backup container
cd /tmp/restore
gsutil cp gs://gcsbucket/yYYYYwWW-incremental-dD-HHMM.tar.bz2 .
tar xvf yYYYYwWW-incremental-dD-HHMM.tar.bz2
⁠Prepare full backup with --redo-only
innobackupex --apply-log --redo-only /tmp/restore/backups/binary/yYYYYwWW-complete/
⁠Apply incremental backup
innobackupex --apply-log /tmp/restore/backups/binary/yYYYYwWW-complete/ --incremental-dir=/tmp/restore/backups/binary/yYYYYwWW-incremental-dD-HHMM/

⁠Rollback uncommitted transactions
innobackupex --apply-log /tmp/restore/backups/binary/yYYYYwWW-complete/

⁠Stop MariaDB container

docker stop myapp-mariadb

⁠Empty Mysql data dir

mkdir /tmp/oldmysql
mv /var/lib/mysql/* /tmp/oldmysql/

⁠Copy back prepared backup

innobackupex --copy-back /tmp/restore/backups/binary/yYYYYwWW-complete/

⁠Start MariaDB container

docker start myapp-mariadb

Tag summary

Content type

Image

Digest

Size

232.5 MB

Last updated

over 8 years ago

docker pull doalitic/mysqlbackups