Showing results for 
Search instead for 
Do you mean 

Recovering Deleted Polarion Data (Part 2 of 2)

by Dreamer on ‎11-27-2012 02:10 PM

By Lutz Dornbusch Oh No! clip artIt can happen to anyone. But it's not necessarily your worst nightmare... ... if a Polarion Work Item or LiveDoc document gets deleted by mistake. Chances are it can be recovered with relative ease, thanks to the fact that Polarion integrates Subversion (SVN). Polarion automatically tracks every change to every development artifact in a SVN repository revision, and SVN can revert any change, including deletes. In this series of 2 articles, I'll show you how to recover both deleted Work Items and deleted LiveDocs. In the first post I covered:
  • Basic preparations for recovery
  • The recovery process
  • How to restore a deleted Work Item
This second article discusses specifics of recovering a deleted LiveDoc document. (Please be sure to read Part 1 of the series first to get the necessary background and prerequisites).

How to Restore a Deleted LiveDoc Document

The process is essentially the same as that for restoring a deleted Work Item:
  1. Check to be sure the object was really deleted and not merely moved. Work Items can be moved to a different LiveDoc. LiveDocs can be moved to a different space.
  2. Locate the SVN folder that last stored the object and checkout this folder
  3. Locate the revision in the folder's history in which the Delete operation was done
  4. Revert changes from this specific revision
  5. Commit changes
Let's follow this step by step for a LiveDoc 1. CHECK IF OBJECT WAS REALLY DELETED AND NOT MOVED Examine the history of your project's Documents. TortoiseSVN’s Repository Browser find the projects "modules" folder. (TIP: I explain how to find your project folder in repository in step 1 of the Work Item revival process in Part 1). Use the TortoiseSVN filter function as before to check for the last commit of your Document. Filter for . If you have no user-defined spaces, the space name is _default. As with a deleted Work Item, the TortoiseSVN client supports you with:
  • a filter
  • icons identifying an action
  • path information
  • "Show All" button in case you don't see any revisions with the filter
Make sure that the last operation on your document was a Delete operation, not a move operation. 2. LOCATE SVN FOLDER OF DOCUMENT'S LAST POSITION AND 'CHECKOUT' THIS FOLDER Often you know where your Document resided before it was deleted. If you do not know, the revision information from step 1 should provide you with the correct path Locate the SVN Folder which contains the Document. This is inside the modules/ folder and is either the name of the space, or _default. For example: If the URL of a deleted document was... http://almserver/repo/Demo Projects/elibrary/modules/FMEA Risk/Risk Specification ...then our folder to be checked out should be: http://almserver/repo/Demo Projects/elibrary/modules/FMEA Risk/ As we saw with Work Items, you can dramatically optimize checkout time by using checkout depth "Only this item". 3. LOCATE REVISION OF THE DELETION IN FOLDER'S HISTORY In step 1 we already located the revision. However this time we need to do it in our working copy checked out in step 2. Right-click on your local folder that was just checked out, and select TortoiseSVN > Show log. Locate the revision corresponding to the the Delete operation as in step 1. (Use filtering if you cannot find it.) 4. REVERT CHANGES FROM THIS SPECIFIC REVISION To revert the changes from this revision, first highlight the revision. If you have only the Delete action in this specific revision (as in the following screenshot ), you can select the revision. Press the right-mouse button and select "Revert changes from this revision". If you have multiple actions in this revision , you should select the specific action you want to revert... which is the Delete action, of course! You might want to review Step 4 of Work Item recovery in Part 1 before doing the Revert action. Regardless if you revert the full revision, or only a single action, there is a dialog in which you need to confirm your decision. The change is then made to your working copy, and the folder containing your document should now appear. 5. COMMIT CHANGES You can now commit the change to your local working copy after which your Document should be restored in the Polarion portal exactly as it was before it was deleted. Even the Recycle Bin has the same state! And that's it. Hopefully, somebody is now so happy they will want to buy you lunch!

IMPORTANT WARNING

  • Never, ever restore a Work Item which was only moved into another Document! You will end up with a corrupted Polarion index. Search for the ID of the Work Item in Polarion and with TortoiseSVN filter.
  • If you restore an older version of a deleted Document, make sure that nobody moved out some Work Items before the deletion. Otherwise you will end up again with duplicate Work Items and a corrupted index.
Note that there is no problem if you reused a Document in a different project, as different projects have different Work Item IDs (even if tracker ID is same!)
About the Author Lutz Dornbusch is a senior consultant with Polarion's Professional Services team. He is based in Düsseldorf, Germany.