How to force delete a TFS 2010 workspace on a client when the TFS Server no longer exists?

I currently have a TFS 2010 server running on SERVER-1 server. On my client (MY-CLIENT) I have VS2010 running and I have a workspace linking SERVER-1 with \ MY-CLIENT \ Development. All is well.

I played with setting up another TFS instance on SERVER-2. On my client, I deleted the original SERVER-1 workspace and created a new workspace linking SERVER-2 with \ MY-CLIENT \ Development. All is well.

Having finished my experiments with TFS on SERVER-2, I again displayed the machine (deleting the TFS server on SERVER-2).

Then I returned to my client computer, connecting it to TFS on the SERVER-1 server and tried to redirect the source code to the development folder. However, now I get the error message " The path \ MY-CLIENT \ Development is already displayed in the workspace MY-CLIENT, SERVER-2 \ Steve ." Now I have a problem.

So, I'm going from this that I had to first remove the SERVER-2 workspace BEFORE re-rendering the machine. Unfortunately, I did not.

In some forums, I understand that I can use the command line tool to remove it:

tf workspace /delete MY-CLIENT;SERVER-2\Steve 

However, when I run this, I get a message that " Team Foundation services are not available from the server http: // SERVER-2: 8080 / tfs / development . "

So the question is, how can I force delete the SERVER-2 workspace on my client so that I can re-create my old SERVER-1 workspace?

+6
source share
3 answers

Work folder mappings for all local workspaces are stored in the version control cache file. This allows you to download TFS clients, allowing them to find server information for a given local folder. In addition, it will provide information for this test, which you see, which prevents the local folder from being displayed on two different servers.

To clear this (without trying to connect to the server), you can use the tf workspaces command (note that pluralization - the workspaces command works in the list of workspaces , the workspace command works with the workspace and usually requires a connection to the server where the workspace is located .

To remove all workspaces for your collection of remote projects, you can do:

 tf workspaces /remove:* /collection:http://server-2:8080/tfs/DefaultCollection 

(Obviously, replacing the project collection URI with the URI for your remote server.)

+16
source

I had the same problem: after moving the TFS server to another machine, I could not map the local folder to VS2012 on the old machine, because it was still associated with the old workspace, which TFS denied. After many hours (and days) of Google searches and attempts at various actions, none of them worked (including all the "tf" commands, deleting the local cache, etc.), Here is how I ended up solving it:

  • Edit the actual TFS collection database on the TFS server using SQL Management Studio Express (for example, "Tfs_DefaultCollection")
  • Find the table "dbo.tbl_Workspace" and edit it.
  • Here you should see your workspace (ghosts)
  • Delete Rows
  • Everything in the world.
+1
source

The workspaceowner parameter in the delete command is optional. Can you remove a delete without this option or damage another MY-CLIENT workspace?

-2
source

Source: https://habr.com/ru/post/908537/


All Articles