This post explains how to move the Tfs_Configuration database alone to another SQL server in Team Foundation Server 2012

Pre-requisites:

The SQL Server on the new server must be a supported version.

The following steps help you move the Tfs_Configuration database to another server and get TFS resume its normal operation.

Moving Tfs_Configuration db – Steps:

Note: The following commands are advised to be run in elevated mode in Cmd, on the server.

Path: Drive:\Program Files\Microsoft Team Foundation Server 11.0\Tools.

Step 1: Stopping Services.

IISRESET /stop

TfsServiceControl quiesce

Now, backup the configuration database and restore it on the new server.

Step 2: Remapping Databases.

TFSConfig RemapDBs /DatabaseName:ServerName;TFS_Configuration /SQLInstances:ServerName,ServerName2 /AnalysisInstance:ServerName2

 /AnalysisDatabaseName:DatabaseName

Note: You can use the /preview at the end to display the actions that you must take to update the configuration. This just shows a preview of what is to be done. Then you can run the same command without /preview to commit the changes.

You can find more information about the TFSConfig RemapDBs command here.

Step 3: Configuring Accounts.

TFSConfig Accounts /ResetOwner /SQLInstance:ServerName /DatabaseName:DatabaseName

You can find more information about the TFSConfig Accounts command here.

Step 4: Reconfiguring Accounts.

TfsConfig Accounts /add /AccountType:ApplicationTier /account:AccountName /SQLInstance:ServerName /DatabaseName:DatabaseName

You can find more information about the TFSConfig Accounts command here.

Step 5: Register Databases.

TfsConfig RegisterDB /SQLInstance:ServerName /DatabaseName:DatabaseName

You can find more information about the TFSConfig RegisterDB command here.

Where,
ServerName, the server where the Configuration database is to be moved.

DatabaseName, the Configuration Database, Usually Tfs_Configuration.

ServerName2, the name of the Server where the collection databases are present.

Step 6: Starting Services.

IISRESET /start

TfsServiceControl unquiesce

That’s it! You have successfully moved the TFS Configuration Database to another SQL Server and Reconfigured TFS to work with it.

Content created by – Manigandan B

Content reviewed by – Romit Gulati