github.com/percona/percona-xtradb-cluster-operator@v1.14.0/deploy/backup/README.md (about)

     1  ## Documentation
     2  Learn more about backups and restores in our [documentation](https://www.percona.com/doc/kubernetes-operator-for-pxc/backups.html).
     3  
     4  ## Make on-demand backup
     5  1. correct the backup name, cluster name, and PVC settings in the `deploy/backup/backup.yaml` file
     6  2. run backup
     7     ```
     8     kubectl apply -f deploy/backup/backup.yaml
     9     ```
    10  ## Restore from backup
    11  1. Make sure that the cluster is running
    12  2. List avaible backups
    13     ```
    14     kubectl get pxc-backup
    15     ```
    16  3. List available clusters
    17     ```
    18     kubectl get pxc
    19     ```
    20  4. start the resoration process
    21     ```
    22     kubectl apply -f deploy/backup/restore.yaml
    23     ```
    24  ## Copy backup to local machine
    25  1. List available backups
    26     ```
    27     kubectl get pxc-backup
    28     ```
    29  2. Download backup
    30     ```
    31     ./deploy/backup/copy-backup.sh <backup-name> path/to/dir
    32     ```
    33  3. Restore backup locally if needed
    34     ```
    35     service mysqld stop
    36     rm -rf /var/lib/mysql/*
    37     cat xtrabackup.stream | xbstream --decompress -x -C /var/lib/mysql
    38     xtrabackup --prepare --target-dir=/var/lib/mysql
    39     chown -R mysql:mysql /var/lib/mysql
    40     service mysqld start
    41     ```
    42  ## Delete backup
    43  1. List available backups
    44     ```
    45     kubectl get pxc-backup
    46     ```
    47  2. Delete backup
    48     ```
    49     kubectl delete pxc-backup/<backup-name>
    50     ```