# Replication with Percona XtraBackup

**URL:** <https://forums.percona.com/t/replication-with-percona-xtrabackup/31014>\
**Category:** Percona Server for MySQL 8.0\
**Tags:** percona\
**Created:** [June 13, 2024, 6:29pm UTC](https://forums.percona.com/t/replication-with-percona-xtrabackup/31014 "2024-06-13T18:29:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antero\_Najera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/antero_najera/32/11284_2.png) [@Antero\_Najera](https://forums.percona.com/u/Antero_Najera)\
**Post date:** [June 13, 2024, 6:29pm UTC](https://forums.percona.com/t/replication-with-percona-xtrabackup/31014/1 "2024-06-13T18:29:11Z")

</div>

Hi, community!  
I’m trying to make a replication following this document [How to set up a replica for replication in 6 simple steps with Percona XtraBackup - Percona XtraBackup](https://docs.percona.com/percona-xtrabackup/8.0/set-up-replication.html#all-the-things-you-will-need). I have a lot questions about de files or paths that I need to use. The main question is what is the common path that I need to put when de document said /path/to/mysql/  
Could give me someone a hand?

---

<div class="post-metadata">

**Author:** ![yunus.uyanik](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/yunus.uyanik/32/19250_2.png) [@yunus.uyanik](https://forums.percona.com/u/yunus.uyanik)\
**Post date:** [June 14, 2024, 8:22am UTC](https://forums.percona.com/t/replication-with-percona-xtrabackup/31014/2 "2024-06-14T08:22:50Z")

</div>

Hi @Antero_Najera  
It’s basically datadir.  
The document refers to `/path/to/mysql/` as a placeholder for the actual location of your MySQL data directory on the server.

Generally, it would be `/var/lib/mysql/`, but to be sure about it you can check yours by following the command;

```auto
mysql> select @@datadir;
+-----------------+
| @@datadir |
+-----------------+
| /var/lib/mysql/ |
+-----------------+
1 row in set (0.00 sec)

```

---

<div class="post-metadata">

**Author:** ![Antero\_Najera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/antero_najera/32/11284_2.png) [@Antero\_Najera](https://forums.percona.com/u/Antero_Najera)\
**Post date:** [June 14, 2024, 9:39pm UTC](https://forums.percona.com/t/replication-with-percona-xtrabackup/31014/3 "2024-06-14T21:39:11Z")

</div>

Hi, yunus!  
I really appreciate your help. Let me make couple questions more.  
When the documentation says “mv /path/to/mysql/datadir /path/to/mysql/datadir\_bak”, is it correct move all the information from this directory to backup directory inside of the same path?

For example:  
mv /var/lib/mysql/ /var/lib/mysql/mysql\_bkp

Following the document, the next step is move this directory but when I execute I got you need to give datadir.

xtrabackup --move-back --target-dir=/path/to/mysql/backupdir

So, my question is the target-dir = /var/lib/mysql/mysql\_bkp and my datadir is again /var/lib/mysql/?

Again, thank you so much for your help!
