Point in time restore

Hi All,

One query which I couldn’t figure out is follows…

Is there any option of Point in Time recovery on Couchbase.

If there is any disaster at 10th minute post to my last periodic backup, only solution I see is to restore from latest backup snapshot, but how about the last 10 minutes data which is not part of last snapshot ?

Am I loosing it completely or Is there any option to restore that as well ?

Thanks!!

Hi,

As far as I know, Point-in-time recovery is not fully supported yet and it is planned to be released soon, but you can still rollback to a specific day using the parameter --to-date (https://developer.couchbase.com/documentation/server/current/cli/cbrestore-tool.html#cdbrestore-tool)

You can also use XDCR to create a hot standby cluster and redirect the traffic to it in case something bad happens.

This post is a year old and I’m wondering if there has been any progress with Point-in-Time recovery?

any progress on this … @deniswsrosa

Hi Deni,
can you update on this ?

looks like tentatively by 2020 they get this in production. As of this feature is not in existence.

Its disappointing to see PIT recovery feature is not yet introduced, even with version 6.5.

1 Like

Hi All,

Point in time for couchbase is possible if you are using third party tools like Talena for backup of couchbase.

1 Like

–point-in-time is there as beta in latest version. Let’s not config it until this is a feature of couchbase official version not like beta. We can use this in lower env. And learn and understand how it works.
Make sure we need to enable this couchbase backup process has to trace each and every mutation in transaction logs or any heap cache after every full backup or incremental backups. For that we need to configure our cluster.
This might slightly impact your cluster performance if you don’t have special backup nodes in your cluster. This I’m talking cb v7.1.3.
I’m still exploring that option how to enable where I need to do configuration. *
Note: we need to add —point-in-time configure option while creating repository using cbbkpmger config
(BETA) This enables Point in Time feature. Which is currently in Beta and is not supported, this should only be used in test environments. When it’s enabled cbbackupmgr will get historical data from the cluster. This will allow restoring to a single point in time. This will increase the amount of space needed to store the backup. The cluster also has to have Point In Time configured to use this feature.

here are the steps for couchbase point in time recovery,and steps:
be aware it is still beta version. this steps only for promote the how to use this features



> ##
> config and create a backup directory along with --point-in-time --encrypted --passphrase options you can ignore --encrypted --passphrase if it is not requre 
> if you add --encrypted --passphrase this options we have to keep remember this passcode as well.
> ##

root@bkpcluster:/couchbase# cbbackupmgr config -a pitr -r local --point-in-time --encrypted --passphrase
Password for --passphrase:
Backup repository `local` created successfully in archive `pitr`
root@bkpcluster:/couchbase#


> ##
> info to know about backups
> ##

root@bkpcluster:/couchbase# cbbackupmgr info -a pitr -r local
Name    | Size | # Backups | Encrypted |
local | 0B   | 0         | true      |
root@bkpcluster:/couchbase#

> ##
> trigger backup backups
> ##

root@bkpcluster:/couchbase# cbbackupmgr backup -a pitr -r local --passphrase -u naveen.karanam -p -c localhost:8091 -t 20
Password for --passphrase:
Password for -p:
Backing up to '2025-02-08T18_18_01.378048193+09_00'
Copied all data in 3m32s (Avg. 108.34MiB/Sec)                                                                                                                                      13830281 items / 22.43GiB
[=========================================================================================================================================================] 100.00%

root@bkpcluster:/couchbase# cbbackupmgr info -a pitr -r local
Name    | Size     | # Backups | Encrypted |
local | 24.20GiB | 1         | true      |

+  Backup                              | Size     | Type | Source                                 | Cluster UUID                     | Range | Events | Aliases | Complete |
+  2025-02-08T18_18_01.378048193+09_00 | 24.20GiB | FULL | localhost:8091 | 6fd34511ad5b77a7f254c0d188459f1b | N/A   | 3      | 0       | true     |
root@bkpcluster:/couchbase# cbbackupmgr info -a pitr -r local --all
Name    | Size     | # Backups | Encrypted |
local | 24.20GiB | 1         | true      |


> ##
> examine to know about available key Timestamps
> ##

cbbackupmgr examine -a pitr -r local --collection-string test._default._default -k ts_last-tsid-0_0 --passphrase

Password for --passphrase:
-- Backup 2025-02-08T18_18_01.378048193+09_00 --
Description: First occurrence of key 'ts_last-tsid-0_0' in this timeline, document created
Cluster UUID: 6fd34511ad5b77a7f254c0d188459f1b
Bucket: test (9090953acca5cda55345403aab17d543)
Timestamp: 2024-12-01T08:59:59Z
Document:
  Key: ts_last-tsid-0_0
  Sequence Number: 14938940
  Deleted: false
  Size: 67B (Key: 16B) (Meta: 29B) (Value: 22B) (XATTRS: 0B)
  Meta:
    Flags: 0
    Expiry: 0
    Locktime: 0
    CAS: 1733043599006105600
    Revseqno: 14938940
    Datatype: 3 (snappy,json)
  Value:
    {
        "last_ts": 1733043599
    }

-- Backup 2025-02-08T18_18_01.378048193+09_00 --
Description: Mutation for document with key 'ts_last-tsid-0_0'
Cluster UUID: 6fd34511ad5b77a7f254c0d188459f1b
Bucket: test (9090953acca5cda55345403aab17d543)
Timestamp: 2024-12-01T09:02:27Z
Document:
  Key: ts_last-tsid-0_0
  Sequence Number: 14939088
  Deleted: false
  Size: 67B (Key: 16B) (Meta: 29B) (Value: 22B) (XATTRS: 0B)
  Meta:
    Flags: 0
    Expiry: 0
    Locktime: 0
    CAS: 1733043747006054400
    Revseqno: 14939088
    Datatype: 3 (snappy,json)
  Value:
    {
        "last_ts": 1733043747
    }



> ##
> Restored back to 2024-12-01T08:59:59Z values(without --force-updates option)
> resoted but it has skipped the document because of couchbase backup stratagy 
> ##

root@bkpcluster:/couchbase# cbbackupmgr restore -a pitr -r local -c localhost:8091  --passphrase --point-in-time 2024-12-01T08:59:59Z --disable-gsi-indexes --include-data test -u naveen.karanam -p
Password for --passphrase:
Password for -p:
Restoring backup '2025-02-08T18_18_01.378048193+09_00'
Copied all data in 5.281s (Avg. 69.15KiB/Sec)                                                                                                                                            1 items / 345.76KiB
[=========================================================================================================================================================] 100.00%

| Transfer
| --------
| Status    | Avg Transfer Rate | Started At                      | Finished At                     | Duration |
| Succeeded | 69.15KiB/s        | Sat, 08 Feb 2025 18:39:06 +0900 | Sat, 08 Feb 2025 18:39:12 +0900 | 5.546s   |

| Bucket
| ------
| Name       | Status    | Transferred | Avg Transfer Rate | Started At                      | Finished At                     | Duration |
| test | Succeeded | 345.76KiB   | 345.76KiB/s       | Sat, 08 Feb 2025 18:39:12 +0900 | Sat, 08 Feb 2025 18:39:12 +0900 | 106ms    |
|
| Mutations                    | Deletions                    | Expirations                  |
| ---------                    | ---------                    | -----------                  |
| Received | Errored | Skipped | Received | Errored | Skipped | Received | Errored | Skipped |
| 0        | 0       | 1       | 0        | 0       | 0       | 0        | 0       | 0       |

Restore completed successfully
root@bkpcluster:/couchbase#

> ##
> Restored back to 2024-12-01T08:59:59Z values(without --force-updates option)
> Tested it has restoed to 2024-12-01T08:59:59Z which is "last_ts": 1733043599 has tested in gui and check couchbase examine value to know more
> ##

root@bkpcluster:/couchbase# cbbackupmgr restore -a pitr -r local -c localhost:8091  --passphrase --point-in-time 2024-12-01T08:59:59Z --disable-gsi-indexes --include-data test -u naveen.karanam -p --force-updates
Password for --passphrase:
Password for -p:
Restoring backup '2025-02-08T18_18_01.378048193+09_00'
Copied all data in 4.272s (Avg. 86.44KiB/Sec)                                                                                                                                            1 items / 345.76KiB
[========================================================================================================================================================] 100.00%

| Transfer
| --------
| Status    | Avg Transfer Rate | Started At                      | Finished At                     | Duration |
| Succeeded | 86.44KiB/s        | Sat, 08 Feb 2025 18:39:40 +0900 | Sat, 08 Feb 2025 18:39:44 +0900 | 4.572s   |

| Bucket
| ------
| Name       | Status    | Transferred | Avg Transfer Rate | Started At                      | Finished At                     | Duration |
| test | Succeeded | 345.76KiB   | 345.76KiB/s       | Sat, 08 Feb 2025 18:39:44 +0900 | Sat, 08 Feb 2025 18:39:44 +0900 | 52ms     |
|
| Mutations                    | Deletions                    | Expirations                  |
| ---------                    | ---------                    | -----------                  |
| Received | Errored | Skipped | Received | Errored | Skipped | Received | Errored | Skipped |
| 1        | 0       | 0       | 0        | 0       | 0       | 0        | 0       | 0       |

Restore completed successfully
root@bkpcluster:/couchbase#


> ##
> Restored back to original values(which is latest)
> Tested it has restoed to 2024-12-01T08:59:59Z which is "last_ts": 1733043747 has tested in gui. and check couchbase examine value to know more
> ##


root@bkpcluster:/couchbase# cbbackupmgr restore -a pitr -r local -c localhost:8091  --passphrase --point-in-time 2024-12-01T09:02:27Z --disable-gsi-indexes --include-data test -u naveen.karanam -p --force-updates
Password for --passphrase:
Password for -p:
Restoring backup '2025-02-08T18_18_01.378048193+09_00'
Copied all data in 4.72s (Avg. 86.44KiB/Sec)                                                                                                                                             1 items / 345.76KiB
[========================================================================================================================================================] 100.00%

| Transfer
| --------
| Status    | Avg Transfer Rate | Started At                      | Finished At                     | Duration |
| Succeeded | 69.15KiB/s        | Sat, 08 Feb 2025 18:40:33 +0900 | Sat, 08 Feb 2025 18:40:38 +0900 | 5.03s    |

| Bucket
| ------
| Name       | Status    | Transferred | Avg Transfer Rate | Started At                      | Finished At                     | Duration |
| test | Succeeded | 345.76KiB   | 345.76KiB/s       | Sat, 08 Feb 2025 18:40:38 +0900 | Sat, 08 Feb 2025 18:40:38 +0900 | 63ms     |
|
| Mutations                    | Deletions                    | Expirations                  |
| ---------                    | ---------                    | -----------                  |
| Received | Errored | Skipped | Received | Errored | Skipped | Received | Errored | Skipped |
| 1        | 0       | 0       | 0        | 0       | 0       | 0        | 0       | 0       |

Restore completed successfully
root@bkpcluster:/couchbase#