Skip to main content

Posts

Showing posts with the label Destroy

Experiences with TFS Destroy

During the last weeks we have been working on cleaning the TFS Version Control from old files. We encountered some unexpected problems, most of which was caused by the fact that the hard drive that holds the database only is 70 GB. The size of the database was around 30 GB and the files to be destroyed were around 15 GB. What we found was that destroying large amounts a data also requires large amount of disk space. The  destroy-command  marks the files to be destroyed and a scheduled job is run each night to perform the actual destroy. This job can also be invoked manually from SQL Management Studio. When the  TfsVersionControl Administration Job  is run the transaction log is filled with up to 2.5 times the size on the data that should be destroyed. That means that before the transaction is committed the size of the log in our case was around 40 GB. This meant that before the transaction could be committed we ran out of disk space and the job was cancelled...

Destroy old data in TFS

Team Foundation Server only performs soft deletes and the files are very easy to recover just by performing an undelete. After a while the deleted files may use a lot of unneccesary space. From TFS 2008 it is possible to erase the data from the database. On option would be to use  tf.exe and the  destroy  command. That however will be pretty tedious when there is more than one file that should be destroyed. I have created a small application to help with this task. The TFS communication is handled in a separate class which i very simple without any error handling. using System; using System.Net; using System.Windows.Forms; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.VersionControl.Client; using Microsoft.TeamFoundation.VersionControl.Common; namespace TFSCleanupTool { internal class TFS { private string ServerName = null; private VersionControlServer VersionControl = null; internal TFS(string servername) ...