Search code examples
sql-servertfsazure-devopsazure-devops-server-2019

Shrinking log file for TFS databases


​We have a TFS2017 environment. The size is growing every week for a long time now.

In this environment , i have multiple collection ; the size of Transaction Log File , is very big (overtop the 155 Gb)

image

My question is : It's safe to do a shirnk of the log file for the defined TFS collection ? (without loss data or getting error in administration console) ?

Thanks


Solution

  • Yes. You can.

    The log file is there so you can restore to a point in time between full backups. If you have backups enabled on your server and regularly take a full backup, then you can truncate the logs after each full backup.

    If you want to just "delete the logs" then temporarily turn off TFS by running this on every application tier server you have: TFSServiceControl quiesce, then truncate the logs, then turn TFS back on using TFSServiceControl unquiesce.

    You may also want to verify your backup strategy. If all is well, you shouldn't see a ever growing log file.

    See: