# Xtrabackup: copy\_file() failed

**URL:** <https://forums.percona.com/t/xtrabackup-copy-file-failed/28264>\
**Category:** Percona XtraBackup\
**Created:** [February 5, 2024, 1:54pm UTC](https://forums.percona.com/t/xtrabackup-copy-file-failed/28264 "2024-02-05T13:54:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![axel](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/axel/32/10423_2.png) [@axel](https://forums.percona.com/u/axel)\
**Post date:** [February 5, 2024, 1:54pm UTC](https://forums.percona.com/t/xtrabackup-copy-file-failed/28264/1 "2024-02-05T13:54:51Z")

</div>

I have a problem creating backup. Both Xtrabackup and Percona MySQL are hosted on separate servers.

These are the set of commands I used to create the backup user:

```auto
CREATE USER 'bkpuser'@'10.XXX.X.XX' IDENTIFIED BY 'XXX';
GRANT BACKUP_ADMIN, PROCESS, RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'bkpuser'@'10.XXX.X.XX';
GRANT SELECT ON performance_schema.log_status TO 'bkpuser'@'10.XXX.X.XX';
GRANT SELECT ON performance_schema.keyring_component_status TO bkpuser@'10.XXX.X.XX';
GRANT SELECT ON performance_schema.replication_group_members TO bkpuser@'10.XXX.X.XX';
FLUSH PRIVILEGES;

```

And this is what I run to create the backup:

`xtrabackup --host=10.XXX.X.XX --user=bkpuser -p'XXX' --backup --compress --target-dir=/root/backup`

I have attached the full log.  
[percona-log.txt](https://forums.percona.com/uploads/short-url/oh8Iqi6BkxIdLlz9ZgsugLtqMCQ.txt) (48.0 KB)

I do want to stress the fact that the file (`/var/log/mysql/mysql-bin.009132`) that xtrabackup complains that it doesn’t exist, does in fact exists.

Could you please help me with this issue? Thanks.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [February 5, 2024, 4:39pm UTC](https://forums.percona.com/t/xtrabackup-copy-file-failed/28264/2 "2024-02-05T16:39:22Z")

</div>

> [@axel](#):
>
> Both Xtrabackup and Percona MySQL are hosted on separate servers.

Percona Xtrabackup is a _physical backup_ tool. You cannot create physical backups when running the backup from a separate machine. You must run PXB on the same host as MySQL.

---

<div class="post-metadata">

**Author:** ![Mughees\_Ahmed](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mughees_ahmed/32/9028_2.png) [@Mughees\_Ahmed](https://forums.percona.com/u/Mughees_Ahmed)\
**Post date:** [February 6, 2024, 1:01pm UTC](https://forums.percona.com/t/xtrabackup-copy-file-failed/28264/3 "2024-02-06T13:01:20Z")

</div>

> [@axel](#):
>
> xtrabackup --host=10.XXX.X.XX --user=bkpuser -p’XXX’ --backup --compress --target-dir=/root/backup

if your goal is to have a backup stored on another server, run the backup on MySQL node and use stream feature , use this link [Streaming MySQL Backups with Percona XtraBackup - Another Alternative](https://www.percona.com/blog/streaming-mysql-backups-with-percona-xtrabackup-another-alternative/)
