Cbbackupmgr restore recently deleted documents

I’m using cbbackupmgr on couchbase 6.6, and had some documents deleted. I have incremental backup running on the hour.

Is there a way to recover just the documents deleted in, say, just the previous hour, or do i have to do something like a full point-in-time restore? Doing that will cause problems because of the changes since the inadvertent delete event.

6.6 doc for cbbackupmgr restore: https://docs.couchbase.com/server/6.6/backup-restore/cbbackupmgr-restore.html

6.6 doc for cbbackupmgr examine https://docs.couchbase.com/server/6.6/backup-restore/cbbackupmgr-examine.html

Things to consider:

  1. cbbackupmgr restore, by default, when restoring to a bucket with data (data includes tombstones), uses conflict resolution so that older data in the backup does not over-write newer data in the bucket. However, this won’t work for your purposes since not over-writing newer data applies to tombstones as well. When you delete a document, there is a tombstone of the document (for a period of time, by default 3 days – see metadata purge interval) that is newer than the document in the backup. Note that the --force-updates option to the restore command over-rides the default behavior and will over-write the data in the cluster even if it’s newer data – but, this will affect all existing data in the bucket so that the older backup data will over-write all the newer data in the bucket (which you do not want).

  2. If you can identify the documents that you want to restore using the [–filter-keys ] or [–filter-values ] options, then, you can filter documents to restore from the backup using those options to the restore command. You may also want to use the [–map-buckets ] option to restore to a new bucket (i.e. a new bucket with no data and no tombstones) so that you can verify that the restore only restores the documents that you want to restore.

  3. You may also want to use cbbackupmgr examine command to examine the documents in the backup to make sure that the documents you want restored from a backup exists in the backup (i.e. that it wasn’t deleted). For example, if you restore a backup from a time A, and if, in that backup, the document with key 123 is a tombstone, then, you’re not going to be able to “restore” that document.

1 Like