How to delete all versions of a file

Document ID : KB000077517
Last Modified Date : 11/06/2018
Show Technical Document Details
Question:
If I want to delete all versions of a file from my repository, and the file can be found in multiple states within my project, how can this be accomplished?
Answer:
If you want to eliminate all versions of a file from all data views in your Harvest repository, it can be complicated.  Different versions of the file may have been promoted to different states within the project, and all these versions must be demoted back to the original state to succeed in using “Delete Version” to delete them.  Here is a method that will accomplish this task.

Notes:
  • Only works if the item you want to remove is not in the baseline
  • Due to “Switch Package” rules, this only works if there are no branch versions (would need to modify the procedure in that case)
  • Only works to remove files, not folders
  • Only works if the item has not been refactored (renamed, or moved, or a parent path renamed, moved or removed)
The steps to follow are:
  1. (if you want to remove, but “keep” the file) In Administrator Tool, create a new state to hold all versions of the item after it has been removed.  You should configure this new state to not have an associated data view.
 User-added image
  1. In Administrator Tool, ensure you have configured promote and demote processes that sequentially pass through every state, both going up and coming down.  Include a “Demote” process from your first state to the new state created in Step 1.  Also ensure that every state has a “Switch Package” process.  To get a graphical representation of your states and the promote/demote paths available, you can right click on the project name and select “View Project Lifecycle”. 
User-added image
 User-added image
  1. In Workbench, find the “itemobjid” of the item you want to remove. 
User-added image 
  1. Find the names of all packages containing any version of the item you want to remove, and in what state each package is found.  If you right click on the version in the Explorer View and select “History Diagram” it should give you a graphical representation of all versions of this file, and the names of the packages in which those versions can be found: 
User-added image 
  1. In Workbench, create a new package in your project’s initial state to contain the versions of the item you want to remove. 
 User-added image
  1. In the initial state, locate any packages containing versions of the item you want to remove and perform “Switch Package” to move those items to the new package. 
 
User-added image
User-added image
 
  1. Promote to the next state and repeat step 6, until you arrive at the last state in your project 
User-added image 
  1. After collecting all versions of the file to be removed, demote the package sequentially back down through all the states until you reach the initial state 
User-added image 
  1. (if you want to remove, but “keep” the file) From there demote from the initial state to the new “cleanup” state.  
User-added image 
  1. (if you want to delete all versions of the file) select all items in the package, then right click and select “Delete Version” 
User-added image