# Information about xtrabackup with MASTER and SLAVE (--master-data)

**URL:** <https://forums.percona.com/t/information-about-xtrabackup-with-master-and-slave-master-data/2321>\
**Category:** Percona XtraBackup\
**Created:** [December 27, 2012, 4:15am UTC](https://forums.percona.com/t/information-about-xtrabackup-with-master-and-slave-master-data/2321 "2012-12-27T04:15:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KoHead](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@KoHead](https://forums.percona.com/u/KoHead)\
**Post date:** [December 27, 2012, 4:15am UTC](https://forums.percona.com/t/information-about-xtrabackup-with-master-and-slave-master-data/2321/1 "2012-12-27T04:15:18Z")

</div>

Hello all,

I have a question about xtrabackup and restoring of backup on slave.

In production environnement i have a server mysql master and multiple slaves servers.

If i want to restore a backup make with xtrabackup on a slave since the master, i have constrain to do a change master to-\> master\_user=‘rep’,-\> master\_password=‘rep’,… in SQL ?

Typically with mysqldump this option is “–master-data”, which automatically appends the CHANGE MASTER TO .

Xtrabackup does not provide a tool for to do that automatically ?

the slave-info option in xtrabackup

Thanks

---

<div class="post-metadata">

**Author:** ![miguelangelnieto](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@miguelangelnieto](https://forums.percona.com/u/miguelangelnieto)\
**Post date:** [December 27, 2012, 4:31am UTC](https://forums.percona.com/t/information-about-xtrabackup-with-master-and-slave-master-data/2321/2 "2012-12-27T04:31:38Z")

</div>

Hi,

Is not possible to automatically run the change master, you have to run it manually after restoring the database.

If you are taking a backup from the master server and want to create a new slave from it you need to read the xtrabackup\_binlog\_info info and get the binary log filename and position from it.

If you are taking a backup from a slave to create another slave you have to run the backup with --slave-info and then after the restore process run the CHANGE MASTER with the information from xtrabackup\_slave\_info file.

You have more detailed information here:

[http://www.percona.com/doc/percona-xtrabackup/howtos/setting](http://www.percona.com/doc/percona-xtrabackup/howtos/setting) \_up\_replication.html

Regards.

---

<div class="post-metadata">

**Author:** ![KoHead](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@KoHead](https://forums.percona.com/u/KoHead)\
**Post date:** [December 27, 2012, 4:59am UTC](https://forums.percona.com/t/information-about-xtrabackup-with-master-and-slave-master-data/2321/3 "2012-12-27T04:59:05Z")

</div>

Hi,

Thanks for your response.

It’s pity, maybe in a futur realase ? it’s a interesting functionnality

I will to write a script for automatically append the change master.

Thanks
