0

Hi dear community of smart people,

I'm setting up MariaDB master/slave replication and for the first time I have decided to try mariabackup utility for transferring the full database backup from master to the slave-to-be.

I'm writing a Bash script to automate the process for future use, and so far it looks like this:

#!/bin/bash

DATADIR='<some_where>'

# Create an empty data dir
mkdir ${DATADIR}

# Fetch the full backup from master as an xb stream
# and extract it by piping to mbstream
ssh primary 'mariabackup --backup --stream=xbstream' | \
    mbstream -C ${DATADIR} -x

# Prepare the backup for import
mariabackup --prepare --target-dir=${DATADIR}

So my question is the following: is it mandatory to do the --prepare step on the master system or I can do that after transferring the raw backup?

  • --prepare can be performed on any host having the sufficient set of the backups. – Kondybas Feb 17 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.