Delen via


Rebuild the client cache

Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018 - TFS 2013

After certain maintenance operations, client computers require a cache refresh. After you move, restore, rename, or fail over a data-tier or application-tier server, you must refresh the cache for tracking work items and users must refresh the version control cache on client computers.

Note

This article applies to project customization of on-premises Azure DevOps Server.

You can force a rebuild of the cache on each client computer the next time it connects to a project collection by using the witadmin rebuildcache command.

Important

To avoid server performance issues, don't run this command during normal operating hours.

How to run the witadmin command-line tool

To run the witadmin command-line tool, open a Command Prompt window where Visual Studio is installed. The witadmin command-line tool installs with any version of Visual Studio. You can access this tool by installing the free version of Visual Studio Community or Visual Studio Team Explorer.

Note

If you are connecting to an on-premises server, you must use the same or later version of Visual Studio or Team Explorer as Azure DevOps Server. For example, if you connect to a TFS 2017 instance, you must connect from Visual Studio 2017 or Team Explorer 2017. There is no Team Explorer 2015 version.

Visual Studio 2017 or Team Explorer 2017 client:

%programfiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

or, TeamExplorer, Professional or Enterprise in place of Community, depending on the version you've installed.

On a 32-bit edition of Windows, replace %programfiles(x86)% with %programfiles%. You can install Visual Studio Community (which provides access to Team Explorer) or Visual Studio Team Explorer 2017 for free.

Prerequisites

  • To use the witadmin rebuildcache command, you must be a member of the Team Foundation Administrators group or the Project Administrators group for the project collection that you want to manage. See Change project collection-level permissions.

Note

Even if you sign in with administrative permissions, 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, choose Start, open the shortcut menu for Command Prompt, and choose Run as Administrator. For more information, see the Microsoft Web site.

Syntax

witadmin rebuildcache /collection:CollectionURL [/noprompt]  

Parameters

Parameter Description
/collection:CollectionURL Specifies the URI of the project collection. For example:
On-premises TFS format: http://ServerName:Port/VirtualDirectoryName/CollectionName

If no virtual directory is used, then the format for the URI is as shown: http://ServerName:Port/CollectionName.
/noprompt Disables the prompt for confirmation.
/? or help Displays help about the command in the Command Prompt window.

Remarks

The witadmin rebuildcache command invalidates cached data on all clients for a specified project collection. It causes a cache refresh for each client the next time the client connects to the project collection.

Example

The following command invalidates the metadata cache for all clients that connect to DefaultCollection that is defined on the server that is named AdventureWorksServer. The client caches are updated the next time they connect to the project collection.

witadmin rebuildcache /collection:http://AdventureWorksServer:8080/tfs/DefaultCollection