github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/docs/user_docs/backup-and-restore/restore/pitr.md (about)

     1  ---
     2  title: PITR
     3  description: How to implement point-in-time recovery of data
     4  keywords: [backup and restore, pitr]
     5  sidebar_position: 7
     6  sidebar_label: PITR
     7  ---
     8  
     9  # PITR
    10  
    11  :::note
    12  
    13  PITR for MySQL and MongoDB is a beta feature.
    14  
    15  :::
    16  
    17  1. View the timestamp which the cluster can be restored to.
    18  
    19     ```bash
    20     kbcli cluster describe mysql-cluster
    21     ...
    22     Data Protection:
    23     AUTO-BACKUP   BACKUP-SCHEDULE   TYPE       BACKUP-TTL   LAST-SCHEDULE                RECOVERABLE-TIME
    24     Enabled       0 18 * * *        datafile   7d           Jul 25,2023 19:36 UTC+0800   Jul 25,2023 14:53:00 UTC+0800 ~ Jul 25,2023 19:07:38 UTC+0800
    25     ```
    26  
    27     `RECOVERABLE-TIME` stands for the time range to which the cluster can be restored.
    28  
    29  2. Run the command below to restore the cluster to the specified point.
    30  
    31     ```bash
    32     kbcli cluster restore mysql-cluster-pitr --restore-to-time 'Jul 25,2023 18:52:53 UTC+0800' --source-cluster mysql-cluster
    33     ```
    34  
    35  3. View the status of the new cluster.
    36  
    37     The status shows `Running` and it means restore is successful.
    38  
    39     ```bash
    40     kbcli cluster list mysql-cluster-pitr
    41     >
    42     NAME                 NAMESPACE   CLUSTER-DEFINITION   VERSION           TERMINATION-POLICY   STATUS    CREATED-TIME
    43     mysql-cluster-pitr   default     apecloud-mysql       ac-mysql-8.0.30   Delete               Running   Jul 25,2023 19:42 UTC+0800
    44     ```