Recovering from Edit Links - Delete All :-((

One of my "helpers" decided to delete links from his module using delete all outgoing links. Unfortunately, he accidently did it to the wrong module. Scolding aside, I have the history of the module for that session, which gives me the objects in the source module that had the link deleted. Now, I have to go to the history of each one of those objects to see what the target ID was (I am sure of the target module, and of the link type). I am populating an attribute in the source module so we can use it to link by attribute to get the links back, and to insure against future fumbles.
I've searched for a while looking for "restore deleted links with history" and such, but can't find anything relevant. Has anyone done something with the history export log (or just the list of objects affected) that goes into the object history, figures out what the target was, and writes that to an attribute, or even restores the link? I don't have the old Kitchen scripts anymore, but there was probably something Ian put in there.

Thanks. Miller time......
cliff.sadler - Tue Feb 08 16:16:05 EST 2011

Re: Recovering from Edit Links - Delete All :-((
SystemAdmin - Tue Feb 08 18:22:52 EST 2011

Have checked the kitchen scripts and PSToolBox - nothing obvious there that will use history as a means to restore deleted links, I'm pretty sure these scripts pre-date the inclusion of link history as a feature in DOORS anyway.

Here's a possible alternative - consider creating a temporary instance of a DOORS DB and restore a BU copy of the production DOORS DB taken prior to this incident (may need to delete the servdata.dtc file if the BU was done whilst the DB service is running). Re-direct a DOORS client to access this new instance so that you can open up the module and see the links that have been deleted. Two options.

1: Use this temporary DB instance as a guide to rebuild the links manually in the production DB.

2: In the DB instance, capture the UID's of target links, export these attributes to a csv file and include the source UID of the module in the export, import this data into the same module on the production DB and then use the Link > Advanced > Link by Attribute menu option to rebuild the links.

There is a lot of detail missing above - if you need more details on how to create a new instance of a DOORS DB (it's surprisingly easy), capture UID's into attributes, export and import then let us know. The kitchen scripts can be useful here as there is a handy function that will copy target UID's into an attribute in the source module - the Kitchen Script menu path is Links > Save Links as an Attribute.

Always handy to have a development level instance of a DOORS DB server readily available for situations like this and many others.
Paul Miller
Melbourne, Australia

Re: Recovering from Edit Links - Delete All :-((
SystemAdmin - Wed Feb 09 01:59:31 EST 2011

Attached is one script which I have been using in similar situations. You have to run it as DOORS Administrator and you have some options at the start of the source code which you can modify, i.e. down to which date to restore links and which link modules to use for searching links and creating links (maybe these two should be empty strings, check the values). Well, it's rough, but it has worked.
Attachments

attachment_14580370_undelete_links_from_history.dxl

Re: Recovering from Edit Links - Delete All :-((
cliff.sadler - Wed Feb 09 08:19:48 EST 2011

Thanks to you both for a prompt reply. Paul, I get what you are saying, and that is probably the easiest path as I do have daily project archives, which I can restore into my sandbox, and export the needed columns. Just wasn't thinking clearly when they disappeared.

Pekka, thank you for the script. I'm sure it will spawn lots of application, especially around metrics reporting from history.