I need take data backup one server to another server using percona xtrabackup full backup and incremental backup how to do it

sudo xtrabackup --backup -u rakesh -p --stream=xbstream --datadir=/var/lib/mysql --tables=“^emp[.]empdata” | ssh root@103.178.113.42 “cat | xbstream -v -x -C /home/naidu”
ssh: connect to host 103.178.113.42 port 22: Connection refused
2023-03-29T15:00:48.530156+05:30 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/var/lib/mysql
2023-03-29T15:00:48.530916+05:30 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --backup=1 --user=rakesh --password --stream=xbstream --tables=^emp[.]empdata
Enter password:
xtrabackup version 8.0.32-25 based on MySQL server 8.0.32 Linux (x86_64) (revision id: 14f007fb)
230329 15:00:55 version_check Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_group=xtrabackup’ as ‘rakesh’ (using password: YES).
230329 15:00:55 version_check Connected to MySQL server
230329 15:00:55 version_check Executing a version check against the server…
230329 15:00:55 version_check Done.
2023-03-29T15:00:56.006257+05:30 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: rakesh, password: set, port: not set, socket: not set
2023-03-29T15:00:56.024348+05:30 0 [Note] [MY-011825] [Xtrabackup] Using server version 8.0.32-0ubuntu0.20.04.2
2023-03-29T15:00:56.035119+05:30 0 [Note] [MY-011825] [Xtrabackup] Executing LOCK INSTANCE FOR BACKUP …
2023-03-29T15:00:56.038528+05:30 0 [Note] [MY-011825] [Xtrabackup] uses posix_fadvise().
2023-03-29T15:00:56.038669+05:30 0 [Note] [MY-011825] [Xtrabackup] cd to /var/lib/mysql
2023-03-29T15:00:56.038766+05:30 0 [Note] [MY-011825] [Xtrabackup] open files limit requested 0, set to 1024
2023-03-29T15:00:56.038930+05:30 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration:
2023-03-29T15:00:56.039019+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = .
2023-03-29T15:00:56.039105+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:12M:autoextend
2023-03-29T15:00:56.039264+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = ./
2023-03-29T15:00:56.039537+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 2
2023-03-29T15:00:56.039775+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 50331648
2023-03-29T15:00:56.047629+05:30 0 [Note] [MY-011825] [Xtrabackup] inititialize_service_handles suceeded
2023-03-29T15:00:57.386645+05:30 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: rakesh, password: set, port: not set, socket: not set
2023-03-29T15:00:57.403066+05:30 0 [Note] [MY-011825] [Xtrabackup] Redo Log Archiving is not set up.
2023-03-29T15:00:57.681756+05:30 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (47787455)
2023-03-29T15:00:58.097573+05:30 0 [Note] [MY-011825] [Xtrabackup] Generating a list of tablespaces
2023-03-29T15:00:58.097726+05:30 0 [Note] [MY-011825] [Xtrabackup] Generating a list of tablespaces
2023-03-29T15:00:58.097780+05:30 0 [Note] [MY-012204] [InnoDB] Scanning ‘./’
2023-03-29T15:00:58.101150+05:30 0 [Note] [MY-012208] [InnoDB] Completed space ID check of 2 files.
2023-03-29T15:00:58.101963+05:30 0 [Warning] [MY-012091] [InnoDB] Allocated tablespace ID 54 for emp/empdata, old maximum was 0
2023-03-29T15:00:58.102563+05:30 0 [Note] [MY-013252] [InnoDB] Using undo tablespace ‘./undo_001’.
2023-03-29T15:00:58.107204+05:30 0 [Note] [MY-013252] [InnoDB] Using undo tablespace ‘./undo_002’.
2023-03-29T15:00:58.108941+05:30 0 [Note] [MY-012910] [InnoDB] Opened 2 existing undo tablespaces.
2023-03-29T15:00:58.117909+05:30 2 [Note] [MY-011825] [Xtrabackup] Streaming ./ibdata1
xtrabackup: Error writing file ‘’ (OS errno 32 - Broken pipe)
xb_stream_write_data() failed.
xtrabackup: Error writing file ‘’ (OS errno 32 - Broken pipe)
2023-03-29T15:00:58.253303+05:30 2 [ERROR] [MY-011825] [Xtrabackup] xtrabackup_copy_datafile() failed
2023-03-29T15:00:58.253381+05:30 2 [ERROR] [MY-011825] [Xtrabackup] failed to copy datafile ./ibdata1
2023-03-29T15:00:58.682236+05:30 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (47787455)

Hi @B_Rakesh

You issue is with SSH connection between both sides:

ssh: connect to host 103.178.113.42 port 22: Connection refused
. . .
xtrabackup: Error writing file ‘’ (OS errno 32 - Broken pipe)

Please check that you have all credentials/firewall rules in place. Test the connection manually via ssh. Once it all succeeds re-try your backup command.

1 Like