TFSConfig commands, deprecated

You can use the TFSConfig command-line tool to perform a variety of administrative actions for your Team Foundation Server (TFS) on-premises deployment. TFSConfig can be run from any machine on which TFS has been installed.

Note

Commands described in this article have been deprecated. For information on active commands, see Use TFSConfig to manage Azure DevOps on-premises. For TFS 2010 and earlier versions, a few of these commands are available in the TFSAdminUtils command-line tool.

Command-line tool location

Azure DevOps command line tools are installed in the /Tools directory of an Azure DevOps application-tier server.

  • Azure DevOps Server 2020: %programfiles%\Azure DevOps Server 2020\Tools
  • Azure DevOps Server 2019: %programfiles%\Azure DevOps Server 2019\Tools
  • TFS 2018: %programfiles%\Microsoft Team Foundation Server 2018\Tools
  • TFS 2017: %programfiles%\Microsoft Team Foundation Server 15.0\Tools
  • TFS 2015: %programfiles%\Microsoft Team Foundation Server 14.0\Tools
  • TFS 2013: %programfiles%\Microsoft Team Foundation Server 12.0\Tools
  • TFS 2012: %programfiles%\Microsoft Team Foundation Server 11.0\Tools
  • TFS 2010: %programfiles%\Microsoft Team Foundation Server 2010\Tools

Prerequisites

  • For commands to operate correctly, TFSConfig needs to connect to the various servers and services which are part of your TFS deployment. The user running TFSConfig needs to have administrative permissions for these same servers and services. Requirements for specific commands are indicated in the information provided for each specific command.
  • Many TFSConfig command must be run from an elevated Command Prompt, even if the running user has administrative.
    credentials. To open an elevated Command Prompt, click Start, right-click Command Prompt, and then choose Run as Administrator. For more information, see: User Account Control.

You can also perform administrative actions interactively using the administration console for TFS. See Administrative task quick reference.

List commands and get help

To display a full list of TFSConfig commands, use the help command:

TFSConfig help

To get help for an individual command, use the help command and specify the name of the command with which you want help. For example, to get help for the accounts command:

TFSConfig help accounts

Diagnose

The diagnose command was deprecated in TFS 2013. Earlier versions are available here:

If you need assistance with diagnosing potential mismatches between software updates on your application-tier and data-tier servers for TFS, contact Developer Community support.

Import

The import command was deprecated in TFS 2013. Earlier versions are available here:

If you need assistance with upgrading data and projects from an earlier version of TFS, see Upgrade TFS, or contact Azure DevOps Services support.

License

You can use the License command to display, modify, or extend the licensing key for your deployment of TFS.

TFSConfig License [/ProductKey:Key] [/extend [NewTrialID]]

Option

Description

/ProductKey: Key

Specifies that the license key for the deployment will be updated with the value of Key.

/extend

Specifies that the trial licensing period for TFS will be extended by 30 days. This option can be used only once without a getting a new trial ID. If a second extension is required, you must obtain a second trial license from Microsoft.

Prerequisites

To use the License command, you must be a member of the Team Foundation Administrators security group. For more information, see Permission reference for TFS.

Remarks

To view, modify, or change the licensing for your deployment interactively, you can use the administration console for Azure DevOps.

For more information, see Open the Azure DevOps Administration Console and Locate or Change the Product Key for TFS.

Examples

The following example shows how to view the licensing information for a deployment of TFS. In this example, the deployment is using a trial license.

TFSConfig License

TFSConfig - Team Foundation Server Configuration Tool
Copyright © Microsoft Corporation. All rights reserved.

Team Foundation Server Standard license
The following features are installed:
Team Foundation Server
Build Services
Build: 21106.00
Product ID: 01234-567-8910
Trial license with 74 days remaining, expiring on 6/30/2010
Trial ID: ABCD-EFGH-IJKL

PrepareClone

The PrepareClone command was deprecated in TFS 2017.

Command availability: TFS 2015 and TFS 2013

The PrepareClone command removes information about scheduled backups, SharePoint, and reporting resources from a TFS deployment.

This command is used in two circumstances:

  • when you move a deployment to new hardware but want to keep using the old deployment
  • when you clone a Azure DevOps Server deployment

In either of these cases it is critical to run this command.

If you don't, the original resources will be used by both the original and the new servers.

If both the original and the new servers are live and point to the same SharePoint or reporting resources for any amount of time, you could end up with corrupted databases.

Important:
This command should be run before configuration, whether you move or clone Azure DevOps Server. If you run it after configuration, you could end up with inconsistencies between content in your databases and content in your web.config file. These inconsistencies might take your server offline. If you have already configured your moved or cloned Azure DevOps Server deployment and realize you need to run the command, follow these steps. First, quiesce your server. Next, run PrepareClone command, ChangeServerID command, and then RemapDBs command. Finally, unquiesce your server.

TFSConfig PrepareClone /SQLInstance:ServerName /DatabaseName:TFSConfigurationDatabaseName [/notificationURL: TFSURL] [/usesqlalwayson]

Option

What it does

/DatabaseName

Specifies the name of the server that hosts the database that you want to map for Azure DevOps Server, in addition to the name of the configuration database itself.

/SQLInstance: ServerName

Specifies the name of the server that you want to map as a server that hosts one or more databases for Azure DevOps Server. If an instance other than the default instance hosts a database, you must also specify the name of the instance.

Use this format: ServerName InstanceName.

/NotificationURL: TFSURL

Optional. Specifies The notification URL for the application-tier server.

/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)](/sql/database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server.

Prerequisites

To use the PrepareClone 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 Azure DevOps Server uses.

For more information, see Permission reference for Azure DevOps Server.

Remarks

You use the PrepareClone command to reconfigure Azure DevOps Server when you move the original installation to new hardware and want to continue to use the original deployment Azure DevOps Server and hardware, or when you want to clone your Azure DevOps Server deployment for testing purposes. You use TFSConfig PrepareClone in conjunction with TFSConfig RemapDBs and TFSConfig ChangeServerID to support the cloning configuration.

Example

The following example shows how to use the command on a moved Azure DevOps Server named NewFabrikamTFS to remove old backup, reporting, and SharePoint resource information. If this information isn't removed, the original deployment of Azure DevOps Server still uses those same resources and databases become corrupt. In the example, the SQL Server supporting the moved Azure DevOps Server is also named NewFabrikamTFS, and the instance is the default instance, so no specific instance information is required, just the server name.

TFSConfig PrepareClone /SQLInstance:NewFabrikamTFS /DatabaseName:TFS_Configuration

PrepareSQL

The prepareSQL command was depracated in TFS 2012. Earlier versions are available here:

Repair

The repair command was depracated in TFS 2012. Earlier versions are available here:

If you need to repair your stored procedures after a failed database patch, contact Azure DevOps Services support.

Updates

The updates command was deprecated in TFS 2013.Earlier versions are available here:

If you need assistance with installing any software updates that are missing from the databases for TFS, contact Azure DevOps Services support.