# Xtrabackup backup to a different server

**URL:** <https://forums.percona.com/t/xtrabackup-backup-to-a-different-server/14841>\
**Category:** Percona XtraDB Cluster 5.x\
**Tags:** mysql, percona\
**Created:** [March 22, 2022, 1:01pm UTC](https://forums.percona.com/t/xtrabackup-backup-to-a-different-server/14841 "2022-03-22T13:01:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravi\_Teja\_RVN](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi_teja_rvn/32/6099_2.png) [@Ravi\_Teja\_RVN](https://forums.percona.com/u/Ravi_Teja_RVN)\
**Post date:** [March 22, 2022, 1:01pm UTC](https://forums.percona.com/t/xtrabackup-backup-to-a-different-server/14841/1 "2022-03-22T13:01:09Z")

</div>

HI Team,

I have a server running with mysql with huge db of 1 TB.

Now, I want to take full backup through percona xtra backup, because incremental backup is easy with percona xtrabackup.

Now,if I initiate taking backup in that server,storage is getting consumed(I dont want this).  
So, I am trying to initate backup in mysql server but the backup need to be stored in a remote server so the existing server storage is not effected.

I have tried the below commands, but even though I have specied remote server ip , it is getting stored in the existing server and storage is getting consumed.

xtrabackup --backup [--remote-host=qrnet@10.16.124.208](mailto:--remote-host=qrnet@10.16.124.208) /home/qrnet/temp

innobackupex [--remote-host=qrnet@10.16.124.208](mailto:--remote-host=qrnet@10.16.124.208) /home/qrnet/temp

so, 10.16.124.208 is the remote server where I need to backup my sql files so that existing server storage does not impact.

But , it is getting stored in the existing server if I perform above commands where the sql is existing.

How to store the backups remotely without effecting existing storage and are there any alternative ways?

---

<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:** [March 22, 2022, 3:16pm UTC](https://forums.percona.com/t/xtrabackup-backup-to-a-different-server/14841/2 "2022-03-22T15:16:14Z")

</div>

You must be using an old version of xtrabackup as I cannot find any references to the `--remote-host` option. In any case, that is not the correct method to stream a backup to another host. Check out our [documentation](https://www.percona.com/doc/percona-xtrabackup/8.0/howtos/recipes_xbk_stream.html) for examples.

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [March 22, 2022, 5:21pm UTC](https://forums.percona.com/t/xtrabackup-backup-to-a-different-server/14841/3 "2022-03-22T17:21:27Z")

</div>

## From the Percona documentation:

On the destination host:

```auto
$ nc -l 9999 | cat - > /data/backups/backup.xbstream

```

On the source host:

```auto
$ xtrabackup --backup --stream=xbstream ./ | nc desthost 9999

```

---

<div class="post-metadata">

**Author:** ![Ravi\_Teja\_RVN](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi_teja_rvn/32/6099_2.png) [@Ravi\_Teja\_RVN](https://forums.percona.com/u/Ravi_Teja_RVN)\
**Post date:** [March 28, 2022, 6:33am UTC](https://forums.percona.com/t/xtrabackup-backup-to-a-different-server/14841/4 "2022-03-28T06:33:58Z")

</div>

HI Team,

I have followed the below steps.

1. stopped mysql service in target server.  
performed below command target server.  
nc -l -p 2112 | unpigz -c | xbstream -x -C /var/lib/mysql

2)on source server ,  
xtrabackup --backup --stream=xbstream --parallel=4 --target-dir=/data/backup | pigz -c --fast | nc -w 2 ssh [qrnet@10.16.12.114](mailto:qrnet@10.16.12.114) 2112

Now, it is getting failed with below error.what could be the issue, I could not find it.

root@e2e-78-247:~# xtrabackup --backup --stream=xbstream --parallel=4 --target-dir=/data/backup | pigz -c --fast | nc -w 2 ssh qrnet@ip 2112  
nc: service “qrnet@ip” unknown  
220328 06:19:56 version\_check Connecting to MySQL server with DSN ‘dbi:mysql:;mysql\_read\_default\_group=xtrabackup’ (using password: NO).  
220328 06:19:56 version\_check Connected to MySQL server  
220328 06:19:56 version\_check Executing a version check against the server…  
220328 06:19:56 version\_check Done.  
220328 06:19:56 Connecting to MySQL server host: localhost, user: not set, password: not set, port: not set, socket: not set  
Using server version 5.7.33-0ubuntu0.18.04.1  
xtrabackup version 2.4.9 based on MySQL server 5.7.13 Linux (x86\_64) (revision id: a467167cdd4)  
xtrabackup: uses posix\_fadvise().  
xtrabackup: cd to /var/lib/mysql  
xtrabackup: open files limit requested 0, set to 500000  
xtrabackup: using the following InnoDB configuration:  
xtrabackup: innodb\_data\_home\_dir = .  
xtrabackup: innodb\_data\_file\_path = ibdata1:12M:autoextend  
xtrabackup: innodb\_log\_group\_home\_dir = ./  
xtrabackup: innodb\_log\_files\_in\_group = 2  
xtrabackup: innodb\_log\_file\_size = 50331648  
InnoDB: Number of pools: 1  
220328 06:19:57 \>\> log scanned up to (85455085555)  
xtrabackup: Generating a list of tablespaces  
InnoDB: Allocated tablespace ID 2619 for qr\_credit\_track/jobCreditsTransaction, old maximum was 0  
xtrabackup: Starting 4 threads for parallel data files transfer  
220328 06:19:57 [02] Streaming ./qr\_credit\_track/jobServiceUserBalance.ibd  
220328 06:19:57 [04] Streaming ./qr\_credit\_track/jobCreditsTransaction.ibd  
220328 06:19:57 [03] Streaming ./qr\_credit\_track/jobServiceUserTransaction.ibd  
220328 06:19:57 [01] Streaming ./ibdata1  
220328 06:19:57 [04] …done  
220328 06:19:57 [04] Streaming ./qr\_credit\_track/jobCreditsAccount.ibd  
220328 06:19:57 [04] …done  
220328 06:19:57 [02] …done  
220328 06:19:57 [04] Streaming ./qr\_credit\_track/jobServicePricing.ibd  
220328 06:19:57 [04] …done  
220328 06:19:57 [03] …done  
220328 06:19:57 [02] Streaming ./qr\_credit\_track/campaign.ibd  
220328 06:19:57 [02] …done  
220328 06:19:57 [02] Streaming ./qr\_credit\_track/impressionAudit.ibd  
220328 06:19:57 [02] …done  
220328 06:19:57 [02] Streaming ./qr\_credit\_track/idconfig.ibd  
220328 06:19:57 [02] …done  
220328 06:19:57 [02] Streaming ./quickride/PassengerRideEx.ibd  
220328 06:19:57 [02] …done  
220328 06:19:57 [02] Streaming ./quickride/UserAppDeviceDetails.ibd  
220328 06:19:57 [02] …done  
xtrabackup: Error writing file ‘UNOPENED’ (Errcode: 32 - Broken pipe)  
[02] xtrabackup: Error: failed to copy datafile.  
xtrabackup: Error writing file ‘UNOPENED’ (Errcode: 32 - Broken pipe)  
[03] xtrabackup: Error: failed to copy datafile.

---

<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:** [March 28, 2022, 1:37pm UTC](https://forums.percona.com/t/xtrabackup-backup-to-a-different-server/14841/5 "2022-03-28T13:37:51Z")

</div>

Your #2 command is wrong. You are doing nc + ssh. Check your command again. If using nc on receiver side, only use nc on sender side.
