# How to restore data form  Machine A to  Machine B

**URL:** <https://forums.percona.com/t/how-to-restore-data-form-machine-a-to-machine-b/8186>\
**Category:** Percona XtraBackup\
**Created:** [October 23, 2020, 9:17pm UTC](https://forums.percona.com/t/how-to-restore-data-form-machine-a-to-machine-b/8186 "2020-10-23T21:17:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pontos](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pontos/32/142_2.png) [@pontos](https://forums.percona.com/u/pontos)\
**Post date:** [October 23, 2020, 9:17pm UTC](https://forums.percona.com/t/how-to-restore-data-form-machine-a-to-machine-b/8186/1 "2020-10-23T21:17:52Z")

</div>

Hi,everyone I have a question when I worked on my project.

I backup my database and create the folder by name like “20201021” on Machine A,

and I copy this folder to Machine B then start restore by “20201021”.it works!

but when I "service mysqld start " mysql can’t start.

I already chown -R mysql: /var/lib/mysql.

my step:

xtrabackup --backup ..=\>create folder “ **20201021** ” on

- **Machine A**
- **switch to Machine B and Copy "20201021" to this Machine**
- service mysqld stop

xtrabackup --user=root --password=123–prepare --target-dir= /

- **20201021**
- **Complete OK**

xtrabackup --prepare --apply-log-only --target-dir=/

- **20201021**
- **Complete OK**

**Clear** /var/lib/mysql on

- **Machine B**

xtrabackup --user=root --password=root --copy-back --target-dir=/

- **20201021**
- **Complete OK**
- chown -R mysql: /var/lib/mysql
- service mysqld start
- **Service Start Failed**
- **This is mysqld log**

 ![image.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/60a57988d7d15c47d440dea7f2af789c4fd51241.jpeg)

---

<div class="post-metadata">

**Author:** ![Nethe](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nethe/32/1430_2.png) [@Nethe](https://forums.percona.com/u/Nethe)\
**Post date:** [October 24, 2020, 12:21pm UTC](https://forums.percona.com/t/how-to-restore-data-form-machine-a-to-machine-b/8186/2 "2020-10-24T12:21:48Z")

</div>

Hello,

If the file binlog.index exists, try to run (group permissions are also important sometimes) chown -R mysql:mysql /var/lib/mysql

Or provide the full output of your error log (cat /var/log/mysql/error.log by default).
