This is a refresh of an original post by Suhid Hasbe and updated for TFS 2008.
There are several options for disaster recover within TFS. In this post we will focu son SQL Log Shipping. Other options include Backup/Restore and SQL Clustering (mirroring).
Log Shipping is very close to Mirroring. The only difference is Mirroring is almost real-time synchronization of databases whereas Log shipping is time delayed synchronization. In short you can synchronize the databases every X minutes. This helps when the geographic locations of primary and secondary servers are far apart for example if you want to have Primary server in the US and Secondary backup server in Asia. You do not want to do mirroring in this case, as it may slow down the primary server.
Terminology: Primary Server – Main TFS Data Tier, Secondary Server – Backup Data tier Server Before you begin you should have installed SQL Server 2005 or SQL 2008 on the secondary server. Following are the steps to setup Log Shipping for TFS
Configure Log shipping
Note: You should configure the transaction log shipping schedule (step 6.1) for all databases at same time. e.g. all of them can run after every 1 hour starting 7:00PM. This is crucial to keep the databases in sync.
Failover to the secondary Database
Important: To failover to the secondary server we have to failover all the databases at the same time.
Restore database <TFSDBName> with Recovery
TFSAdminUtil RenameDT <SecondaryServer>
TFS Databases: ReportServer, ReportServerTempDB, STS_Config_TFS, STS_Content_TFS, TfsBuild, TfsIntegration, TfsVersionControl, TfsWarehouse, TfsWorkItemTracking, TfsWorkItemTrackingAttachments, TfsActivityLogging