One of the ways Microsoft has facilitated the administration and deployment of Team System is by putting most of the configuration settings and data on SQL Server 2005. The backup process in Team System can be broken down into three logical steps:
Back up Team Foundation Server: One of the easiest ways of backing up Team Foundation Server is by using a third-party solution such as Norton Ghost. You can also back up individual attachments by using the Registration Web service at the following URL:
Look at the location of the attachments (/VSTS/WorkItemTracking/Attachments). Turn off TFSServerScheduler and Internet Information Server (using iisrest /stop). Then you can easily save your attachments.
Back up SQL Server 2005: SQL Server 2005 can't be imaged — otherwise, you will lose the capability to use your logs to recover data. You should use the SQL Server 2005 data backup tools within the SQL Server 2005 Management Studio. Be sure to do a file backup of .bak files to restore later.
Back up Windows SharePoint Services: You can back up SharePoint by using the following command:
%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\60\bin \stsadm.exe -o backup -url http://localhost -filename backup.dat
The MSDN documentation also has steps to back up all the individual tables within SQL Server 2005 if you need that extra level of control and schedule your backups.
To restore a Team Foundation Server backup (assuming you have a clean Team Foundation Server install ready to go), follow these steps:
Stop your "clean" instance of Team Foundation Server by using the command net stop TFS.
On SQL Server 2005, copy the .bak files. Open SQL Server Management Studio and choose Task Restore Database. Make sure that you overwrite the current database.
You should then restart the application and data tiers by using the commands net start TFS (to start up the Team Foundation Server) and iisreset (to restart IIS).
Finally, restore the SharePoint site by typing the following command:
"%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\60\bin"\stsadm.exe -o restore -url http://localhost -filename backup.dat -overwrite
If you choose to use imaging software as part of your backup strategy, be aware that problems may occur if you try to restore on a different computer or server.