The recovery of an accidentally deleted version with all the edits is possible, but do not tell to the user right away and set low expectations for recovery. It might be possible to salvage the version and its edits if the following is done:
- Create a backup. Please note that a previous backup is not useful. It is important to create a backup immediately after the version is deleted accidentally.
- Ask the user not to compress the backup data. The reason is that after the data is compressed, the state lineage that corresponds to the deleted version is also permanently deleted.
- Instruct the user not to reconcile and/or post the parent of the version that was deleted. The reason being that the state id of the parent is changed, and it will be even more challenging to get the deleted version back to the same state it was in when deleted.
- The users can do their edits, but not reconcile and/or post. They can continue to save their edits.
- After instructing the user to do all of the steps above, tell the user to backup the data and provide a dump of that data. Then try to restore the lineage in-house, find the SQL to fix the lineage, and send back the SQL that the user will need to fix the lineage themselves.
Set the customer expectation to something like, "I am sorry but after you delete a version, you lose the version. But I will do my best to try to help get that version back for you".