I’ve tried to restore s3 backup to new pxc cluster with percona-xtradb-cluster-operator/deploy/backup/restore-backup.sh but I have this error :
+ mc -C /tmp/mc cat dest/mysql-operator/cluster1-2022-04-04-08:58:00-full
+ xbstream --decompress -x -C /datadir
mc: <ERROR> Unable to read from `dest/mysql-operator/cluster1-2022-04-04-08:58:00-full`. Object does not exist.
After some research I’ve modified restore-backup.sh and now it restore backup from s3 to new pxc cluster but I’ve new error when start_pxc() it’s called :
Error from server (Conflict): error when applying patch:
{"metadata":{"creationTimestamp":"2022-04-04T09:25:57Z","resourceVersion":"1001431717","uid":"8c2494d9-60db-4462-a9b5-cc04fe874880"},"status":{"conditions":[{"lastTransitionTime":"2022-04-04T09:25:57Z","status":"True","type":"initializing"},{"lastTransitionTime":"2022-04-04T09:28:36Z","status":"True","type":"ready"}],"haproxy":{"ready":3,"status":"ready"},"pxc":{"image":"percona/percona-xtradb-cluster:8.0.23-14.1","ready":3,"status":"ready","version":"8.0.23-14.1"},"ready":6,"state":"ready"}}
to:
Resource: "pxc.percona.com/v1, Resource=perconaxtradbclusters", GroupVersionKind: "pxc.percona.com/v1, Kind=PerconaXtraDBCluster"
Name: "cluster1-restored", Namespace: "xtradb-from-scratch"
for: "/tmp/tmp.Q8F945epbH/cluster.yaml": Operation cannot be fulfilled on perconaxtradbclusters.pxc.percona.com "cluster1-restored": the object has been modified; please apply your changes to the latest version and try again
this script percona-xtradb-cluster-operator/deploy/backup/restore-backup.sh was created long before our operator supported restore operation. It is heavily outdated.
We recommend to use the restore custom resource for restoration. See more details here: Providing Backups
In short you just need to create a restore manifest. An example of it you can find in percona-xtradb-cluster-operator/deploy/backup/restore.yaml