# Disaster recovery for mysql database

**URL:** <https://forums.percona.com/t/disaster-recovery-for-mysql-database/38286>\
**Category:** Uncategorized\
**Tags:** mysql, percona\
**Created:** [June 11, 2025, 11:26am UTC](https://forums.percona.com/t/disaster-recovery-for-mysql-database/38286 "2025-06-11T11:26:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya1523](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aditya1523/32/20039_2.png) [@Aditya1523](https://forums.percona.com/u/Aditya1523)\
**Post date:** [June 11, 2025, 11:26am UTC](https://forums.percona.com/t/disaster-recovery-for-mysql-database/38286/1 "2025-06-11T11:26:12Z")

</div>

Hello Percona Support,  
I’m running the Percona Operator with a Percona XtraDB Cluster (image: percona/percona-xtradb-cluster:8.0.31-23.2) on Kubernetes. I’ve configured:

```auto
storages:
  ostore:
    type: s3
    verifyTLS: false
    s3:
      bucket: devops/dev/mysql/fullbackup
      endpointUrl: https://example.r2.cloudflarestorage.com
      credentialsSecret: s3-backup-secret
  minio:
    type: s3
    verifyTLS: false
    s3:
      bucket: mysql-backup-pitr
      endpointUrl: https://minio.example.ostore.com
      credentialsSecret: s3-backup-pitr-secret

```

Daily full backups to Cloudflare R2 and continuous PITR logs to MinIO are running without issue. I can successfully restore a full backup (for example, the snapshot taken at 00:01 AM), but I’m unclear on how to apply the PITR logs afterward to bring the cluster back to a specific point in time—say, 11:30 AM today—without losing any data. Could you outline the steps or point me to the documentation for performing a point-in-time recovery in this setup?  
And my restoration file for fullbackup is:

```auto
apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBClusterRestore
metadata:
  name: restore123
spec:
  pxcCluster: pxccluster
  backupSource:
    destination: s3://mysql-backup-prod/pxccluster-2025-02-22-08:41:15-full/
    s3:
      bucket: mysql-backup-prod
      credentialsSecret: s3-backup-secret
      region: us-east-1
      endpointUrl: https://example.r2.cloudflarestorage.com

```

---

<div class="post-metadata">

**Author:** ![Abhinav\_Gupta](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/abhinav_gupta/32/6262_2.png) [@Abhinav\_Gupta](https://forums.percona.com/u/Abhinav_Gupta)\
**Post date:** [June 11, 2025, 1:41pm UTC](https://forums.percona.com/t/disaster-recovery-for-mysql-database/38286/2 "2025-06-11T13:41:31Z")

</div>

You can follow the steps mentioned in the documentation below.

> **[Restore from a previously saved backup - Percona Operator for MySQL](https://docs.percona.com/percona-operator-for-mysql/pxc/backups-restore.html#restore-the-cluster-with-point-in-time-recovery)**
>
> The backup is normally restored on the Kubernetes cluster where it was made,
> but restoring it on a different Kubernetes-based environment with the installed Operator is also possible.

i.e. mainly PITR section of the [restore.yaml](https://github.com/percona/percona-xtradb-cluster-operator/blob/main/deploy/backup/restore.yaml) needs to be properly configured.

- put additional restoration parameters to the `pitr` section:
  - `type` key can be equal to one of the following options,
    - `date` - roll back to specific date,
    - `transaction` - roll back to a specific transaction (available since Operator 1.8.0),
    - `latest` - recover to the latest possible transaction,
    - `skip` - skip a specific transaction (available since Operator 1.7.0).

  - `date` key is used with `type=date` option and contains value in datetime format,
  - `gtid` key (available since the Operator 1.8.0) is used with `type=transaction` option and contains exact GTID of a transaction **which follows** the last transaction included into the recovery

---

<div class="post-metadata">

**Author:** ![Aditya1523](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aditya1523/32/20039_2.png) [@Aditya1523](https://forums.percona.com/u/Aditya1523)\
**Post date:** [June 30, 2025, 5:54am UTC](https://forums.percona.com/t/disaster-recovery-for-mysql-database/38286/3 "2025-06-30T05:54:02Z")

</div>

Hi Abhinav, My full backup and pitr are working fine but while restoring I am getting error in the restoration job.

```auto
Can't create/write to file './performance_schema/objects_summary__107.sdi' (OS errno 24 - Too many open files)

```

And my Yaml file which I applied is this:

````auto
apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBClusterRestore
metadata:
  name: restore1356
spec:
  pxcCluster: pxccluster
  backupSource:
    destination: s3://devops/dev/mysql/fullbackup/pxccluster-2025-06-26-02:00:30-full/
    s3:
      bucket: devops/dev/mysql/fullbackup
      credentialsSecret: s3-backup-secret
      region: us-east-1
      endpointUrl: https://example.r2.cloudflarestorage.com
  pitr:
    type: latest
    # date: "2025-06-11 16:31:28"
    # gtid: "binlog_1749638158_d323799c3751af5b9d313553baf60c9b-gtid-set"
    backupSource:
      storageName: "minio"
      s3:
        bucket: mysql-backup-dev-pitr
        credentialsSecret: s3-backup-pitr-secret
        endpointUrl: https://ostore.example.tech```
I want to know what is this issue and do i make any more changes in the yaml so that, this error can be remidiated.
````
