Anyone running big projects with TFS will eventually run into this issue. The databases are getting bigger as time goes on. There are many causes; below you have the most common and solutions to keep them in check
1. Test attachments. Whenever you run a test, be it unit test or other kind which is controlled by TFS, several files are stored in the database such as to allow easy reproduction of issues found. This is a nice feature. What is not nice is that you cannot delete them through some common feature provided by MS. What you can do is
- install TFS Administrator Toolkit (you can get it from the online extensions repository from Visual Studio) and run Test Attachment Sizes plugin to find out how much space is eaten by them
- run the TFS Attachment Cleaner with a configuration file specific for deleting those files that eat too much space (this might take a while so be patient)
2. Storing dll’s in the repository. Sometimes this is a must but developers overdo it and they store all kind of shit in source control. Using the TFS Administrator Toolkit you can “Search large files” and try to figure out what is happening. When you have to delete something use TFSSCExplorerExtension (also found on the online extensions repository) to permanently delete those files (destroy). Just marking them as deleted does not actually release space from the database.
3. Projects are adding up. This is a fact of life. What you can do, is decide what you want to archive and do so. To archive a project is not a trivial task especially when you want to keep the history. What you can do is to split the project collection in two and then delete from each of the two the ones not needed such that you end up with one project collection that contain archived projects and one containing active projects. The one with archived projects you can detach from TFS and dump it on a tape drive or whatever backup means you have. Later you can restore it by attaching it to the TFS.
That’s it for now. I can detail these steps if someone needs it