KubeBlocks supports restoring clusters from backups with the following instructions.
View backups.
kubectl get backups
For existing clusters, execute:
kbcli cluster list-backups mysql-cluster
If the cluster has been deleted, execute:
kbcli dataprotection list-backups
Restore clusters from a specific backup.
You can set the connectionPassword.annotations of the restored cluster as that of the original cluster. The password of the original cluster can be accessed by viewing the annotation of dataprotection.kubeblocks.io/connection-password in the backup YAML file.
# Restore new cluster
kbcli cluster restore myrestore --backup mybackup
>
Cluster myrestore created
# View the status of the restored cluster
kbcli cluster list myrestore
>
NAME NAMESPACE CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS CREATED-TIME
myrestore default apecloud-mysql ac-mysql-8.0.30 Delete Running Oct 30,2023 16:26 UTC+0800
Connect to the restored cluster for verification. Once the cluster status is Running, connect to the cluster for verification.