Public | Automated Build

Last pushed: 6 days ago
Short Description
Docker MySQL Backups Image
Full Description

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


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
Docker Pull Command
Source Repository

Comments (0)