Backup restore with and without --force-updates: differences

Hi everyone,
I’m new to Couchbase (7.2.0) and have a question regarding restoring backups and specifically the “cbbackupmgr restore” command.

I find it hard to see a usecase where I wouldn’t want to use the “–force-updates” flag when restoring the database from a backup. Restoring without the flag seems to do nothing because every change in the database (insert, delete, etc) since the backup seems to be considered newer than the backup and is therefore not changed.

Is there something I am not seeing? Does the restore without “–force-updates” only restore somehow corrupted files? What would be a usecase where you would not use “–force-updates”?

Thanks in advance and best regards

What would be a usecase where you would not use “–force-updates”?

When you are restoring bank account accounts where some had accidentally been deleted. You don’t want to overwrite current balances with last week’s balances. But you want the missing accounts restored.

That is kind of my problem at the moment.
Let’s say I have bank accounts A,B,C and make a Backup at time X.
At time Y I update account A and accidentally delete bank account B.
At time Z I restore with the backup at time X.

In my setup, when restoring without using --force-updates every document gets “skipped”. Nothing changes. B is still missing and A is updated. Is this correct behaviour?

@hyunjuV - can you help with this? Thanks.

I agree that the behavior is a little odd. By default, when restoring, conflict resolution is used. So, if the document already exists that’s newer than the one in the backup, it’s not over-written by the backup (unless --force-updates is used). The same is true if you have a tombstone. So, if you have document, docid1, and you delete it, the tombstone still exists, and since it’s newer than the docid1 in the backup, so it’s not over-written. If the tombstone for the docid1 has been purged, then, the docid1 will be restored. ( Documentation about tombstones purging is here – )


Thank you for explaining!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.