0

My TFS Database is growing rapidely. I need to know how I can figure out what is taking most of that space and find a way to destroy the information that I don't need to keep. We are using GIT inside TFS. Does GIT in TFS manage Branches the same way it does on our PC or it create a copy of all the files?

At the end, I would like to reduce the required space for the database file.

thanks

Captain Kirk
  • 63
  • 2
  • 9
  • You need to specify what version of TFS. But I'm guessing that someone (or several people) are checking in binary files into source control and using it as a file repository. Instead of a source control repo. TFS compares the text of files and stores the deltas. If it can read the files as text (.dll, .exe) then it just stores the check ins as new files. It's close to impossible to reduce the size of TFS dbs – Dbloch Jul 06 '17 at 20:09
  • tfs 2015. no binary files (bin folder and obj) – Captain Kirk Jul 06 '17 at 20:16
  • Run this query against the collection database https://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database Let us know which table or top 5 tables are using the space – Dbloch Jul 06 '17 at 20:46
  • Rules is the top one. Then, tbl_GitCommitChange come second and Constants third. – Captain Kirk Jul 07 '17 at 16:20

1 Answers1

1

Files aren’t stored on the file system like they would be when git is running on your local machine. Instead they are stored in the TFS SQL server database.

If there are many users who frequently modify and commit the changes, the tables you mentioned will be growing accordingly.

You can refer to this article to see how the git files are stored, then figure out what caused the Database growth.

Normally, the files you committed/attached will be stored in tbl_Content Table, so, you can also check if there is the abnormal growth for that table based on this article.

To clean up and reduce the size of the TFS database, there are a couple of ways to clean your TFS database:

You can also reference this article: https://social.technet.microsoft.com/wiki/contents/articles/19932.reduce-the-size-of-tfs-databases-after-cleaning-some-source-control-files.aspx

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55