RemapDBs Command

You can use the RemapDBs command to redirect Visual Studio Team Foundation Server to its databases when they are stored on more than one server and you are restoring, moving, or otherwise changing the configuration of your deployment. For example, you must redirect Team Foundation Server to any databases for team project collections if they are hosted on a separate server or servers from the configuration database. You must also redirect Team Foundation Server to the server or servers that are running SQL Server Analysis Services or SQL Server Reporting Services if those databases are hosted on a separate server or instance from the configuration database.

Required Permissions

To use the RemapDBs command, you must be a member of the Team Foundation Administrators security group and a member of the sysadmin security group for any SQL Server databases that Team Foundation Server uses. For more information, see Team Foundation Server Permissions.

Note

Even if you log on with administrative credentials, you must open an elevated Command Prompt window to perform this function on a server that is running Windows Server 2008. To open an elevated Command Prompt window, click Start, right-click Command Prompt, and then click Run as Administrator. For more information, see this page on the Microsoft Web site: User Account Control.

TFSConfig RemapDBs /DatabaseName:ServerName;DatabaseName /SQLInstances:ServerName1,ServerName2 [/AnalysisInstance:ServerName] [/AnalysisDatabaseName:DatabaseName] [/preview] [/continue]

Parameters

Argument

Description

ServerName

Specifies the name of the server that you want to map as a server that hosts one or more databases for Team Foundation Server. If an instance other than the default instance hosts a database, you must also specify the name of the instance in the following format:

ServerName\InstanceName

DatabaseName

Specifies the name of the database that you are mapping to Team Foundation Server.

Option

Description

/DatabaseName

Specifies the name of the server that hosts the database that you want to map for Team Foundation Server, in addition to the name of the database itself.

/SQLInstances:ServerName1,ServerName2

Specifies the name of the server that is running SQL Server, in addition to the name of the instance if you want to use an instance other than the default instance.

If you are specifying more than one server, you must use a comma to separate multiple pairs of server and instance names.

/AnalysisInstance:ServerName

Optional. Specifies the name of the server and instance that hosts SQL Server Analysis Services. Use this option to specify the server and instance that hosts the Analysis Services database.

/AnalysisDatabaseName:DatabaseName

Optional. Specifies the name of the Analysis Services database that you want to use with Team Foundation Server if you have more than one such database on the server that you specified with the /AnalysisInstance option.

/preview

Optional. Displays the actions that you must take to update the configuration.

/continue

Optional. Specifies that the RemapDB command should continue even if an error occurs during the attempt to locate one or more databases. If you use the /continue option, any collections whose databases are not found on the server or servers that you specify will be reconfigured to use the server and instance that hosts the configuration database.

Remarks

You use the RemapDBs command to reconfigure Team Foundation Server to use different servers and instances of SQL Server from the servers and instances in the original installation.

Example

The following example shows how to redirect Team Foundation Server to its configuration database TFS_Configuration. This database is hosted on ContosoMain on the named instance TeamDatabases. Its project collection databases are stored on both ContosoMain\TeamDatabases and the default instance on Contoso2.

TFSConfig RemapDBs /DatabaseName:ContosoMain\TeamDatabases;TFS_Configuration /SQLInstances:ContosoMain\TeamDatabases,Contoso2

See Also

Other Resources

Managing Server Configuration with TFSConfig