Working with MariaDB backup, mariabackup, mbstream (xbstream)

Make a backup of everything use on the fly compression:
mariabackup --defaults-file=/etc/my.cnf.d/server.cnf --backup --no-lock --user=root --password="" --stream=xbstream > ~/uncompressed.xbstream
ls -lah ~
Unpack uncopressed container:
mkdir ~/uncompressed
cd ~/uncompressed
mbstream -x < ~/uncompressed.xbstream
Check archive:
mariabackup --prepare --target-dir .
Not the message "This target seems to be not prepared yet". By running the command again, it will show "This target seems to be already prepared".

Restore:
rm /var/lib/mysql/* -rf
cd ~/uncompressed
mariabackup --copy-back --target-dir .

No comments: