I few weeks ago I wrote a post about Control\Reduce TFS DB Size after received a “There is not enough space on the disk” message. That post shows how to identify what Test Attachments types are taking so much space and using the MS Test Attachment Cleaner to remove them from TFS repository.
Two things, first I don’t like using Command Line tool – I prefer UI, so using MS Test Attachment Cleaner isn’t my favorite.
Second, there are other things beside Test Attachment what consume a lot of space in TFS.
So I decide to create a tool that will allow me See and Clean things I don’t need so I can release some space and junk.
So let’s start, the tool called – TFS Cleaner and have 4 sections, each section is responsible for specific area in TFS.
** The Tool Uses TFS API – No Direct Calls to SQL **
Workspace and Shelves
This sections allows to query for Workspaces that wasn’t changes in the past 30 days (you can change the Max Days) and shows Shelves that are older than 30 Days. For each Workspace item you can see the mappings.
You can specify that search for a specific owner, and once the search is complete you can Copy the details to Clipboard so you can send it the owner to check if it safe to delete.
For many of my customers Source Control is responsible for Huge DB Size, due to the fact that customers adds not just source files but also binary files.
When a binary is replace with another version a new revision is created and basically multiply the size for each revision.
Source Control sections allow to you to easily browse Source Tree and see each file and folder size, this works per folder you open so you don’t have to wait until the entire tree size is calculated (can takes hours).
For each file and folder you can see the revisions and also copy the item details so you can check with the item owner if the item is needed and if not you can destroy the item.
You can also filter to display just deleted items and use the destroy button the completely remove those items from Source Control.
Test Attachment Cleaner
Same as MS Test Attachment Cleaner but with UI you can specify what file extensions to search and limit the search for work item state.
Of course you can define date range and file attachment size.
The builds section allow you to search for builds based on their status, you can search for deleted builds and destroy full build definition with all his children’s.