# How to restore database using ip address or DNS entry

**URL:** <https://forums.percona.com/t/how-to-restore-database-using-ip-address-or-dns-entry/25671>\
**Category:** MySQL & MariaDB\
**Tags:** mysql, percona\
**Created:** [October 5, 2023, 2:49am UTC](https://forums.percona.com/t/how-to-restore-database-using-ip-address-or-dns-entry/25671 "2023-10-05T02:49:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chethan4046](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@chethan4046](https://forums.percona.com/u/chethan4046)\
**Post date:** [October 5, 2023, 2:49am UTC](https://forums.percona.com/t/how-to-restore-database-using-ip-address-or-dns-entry/25671/1 "2023-10-05T02:49:11Z")

</div>

I have new serve create in different machine i have only have access using IP address in another hand i have service url of k8s it pxc.pxc.svc.cluster.local  
can i restore database  
currently i am trying this seems not working  
`xtrabackup --copy-back --no-defaults -uuser -p -P 5306 -h pxc.pxc.svc.cluster.local --force-non-empty-directories --target-dir=xtrabackup/ --innodb_undo_directory=/home/backup`

Error  
some time it says completed ok but no database restored ,  
and some time  
pxc.pxc.svc.cluster.local/ibdata1’ (OS errno 17 - File exists)  
@fward1208 @Mauricio_Cacho

---

<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:** [October 5, 2023, 3:01pm UTC](https://forums.percona.com/t/how-to-restore-database-using-ip-address-or-dns-entry/25671/2 "2023-10-05T15:01:57Z")

</div>

Hello @chethan4046,  
Percona Xtrabackup (PXB) is not a logical backup tool. PXB is a physical backup tool. Thus, you must have direct access to the disk were MySQL is running for restore. You must first copy the backup taken by PXB to the new server in question, using rsync or scp, and then on that machine, you can prepare the backup and start MySQL.

---

<div class="post-metadata">

**Author:** ![chethan4046](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@chethan4046](https://forums.percona.com/u/chethan4046)\
**Post date:** [October 5, 2023, 3:07pm UTC](https://forums.percona.com/t/how-to-restore-database-using-ip-address-or-dns-entry/25671/3 "2023-10-05T15:07:57Z")

</div>

@matthewb Thanks for your replay,  
But in my case i am running mysql server as k8s pod, How to restore inside pod by copying backup inside pod it self ?

---

<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:** [October 5, 2023, 3:17pm UTC](https://forums.percona.com/t/how-to-restore-database-using-ip-address-or-dns-entry/25671/4 "2023-10-05T15:17:55Z")

</div>

I’m not a K8S expert, but I think you’d have to do something like create a persistent volume, copy the backup into that volume, then launch a new K8S pod and attach that volume to that pod.  
If you database is small, \< 200GB, then you can do a logical backup/restore using something like mydumper/myloader which can be done remotely
