Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Created April 23, 2018 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahemoff/99a8a3f8ba926c4729a08e7829162ddd to your computer and use it in GitHub Desktop.
Save mahemoff/99a8a3f8ba926c4729a08e7829162ddd to your computer and use it in GitHub Desktop.

MySQL backup commands and sizes

Adventures in storing and backing up a typical database using innobackupex and gpg. Using gzipped tar due to ubiquity, even though it's possibly 10-20% worse on perf/storage.

Sizes:

PREPARED (ie ready to move to MySQL folder)

  • 2800MB Uncompressed and prepared (roughly the size of live database)
  • 21000MB Uncompressed before compression
  • 700MB Crypted+Compressed (ideal for external storage)

Simple encryption model with shared keys:

innobackupex --stream=tar ./ | gpg --symmetric --passphrase=$(cat /home/db/db.key) > backup.tgz.crypt

Decrypt:

(cd ~/restore ; gpg --decrypt --passphrase=$(cat /home/db/db.key) backup.tgz.crypt | tar xvf -)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment