RegisterDB Command

Use RegisterDB to update name of the server that hosts the configuration database in Visual Studio Team Foundation Server (TFS). You might use this command when restoring the configuration database to new hardware or when changing the domain of a deployment.

Important

For the RegisterDB command to succeed, the following application pools and programs must be running:

  • Team Foundation Server Application Pool (application pool)

  • ReportServer (application pool)

  • SQL Server Reporting Services (program) 

In addition, the following components must not be open or running:

Required Permissions

To use the RegisterDB command, you must be a member of the Team Foundation Administrators group on the application-tier server for Team Foundation and a member of the sysadmin group in SQL Server on the data-tier server for Team Foundation. For more information, see Permission reference for Team Foundation Server.

Note

Even if you are logged on with administrative credentials, you must open an elevated Command Prompt to perform this function.

TFSConfig RegisterDB /SQLInstance:ServerName /databaseName: DatabaseName [/usesqlalwayson]

Parameters

Placeholder

Description

ServerName

Specifies the name of the server that hosts the configuration database for TFS and the name of the instance if you want to use an instance other than the default instance. If you specify an instance, you must use the following format:

ServerName\InstanceName

DatabaseName

Specifies the name of the configuration database that you want to register with TFS.

Argument

Description

/SQLInstance:ServerName

Required. Specifies the name of the server that is running SQL Server and the name of the instance if you want to use an instance other than the default instance. If you specify an instance, you must use the following format:

ServerName\InstanceName

/databaseName:DatabaseName

Required. Specifies the name of the configuration database. By default, this is Tfs_Configuration.

/usesqlalwayson

Optional. Specifies that the databases are part of an AlwaysOn Availability Group in SQL Server. If configured, this option sets MultiSubnetFailover in the connection string.

For more information, see AlwaysOn Availability Groups (SQL Server).

Remarks

Important

Back up the databases for TFS before you use this command.

You must provide the exact name or address of the configuration database for this command to operate correctly. If you must change the server on which this database is stored, you must ensure that TFS points to the new location.

Example

The following example redirects TFS to a configuration database that is located on the server ContosoMain in the SQL Server instance TeamDatabases.

Note

The examples are for illustration only and are fictitious. No real association is intended or inferred.

TFSConfig RegisterDB /SQLInstance:ContosoMain\TeamDatabases /databaseName:Tfs_Configuration