locked
Delete orphaned workspaces from TFS

    Question

  • I recently experienced a situation where a TFS 2010 server was lost and the only thing salvaged was a SQL backup of just one project collection database. I was able to build a new server and use the restore command to get the old collection database attached and online. However, there are some workspaces left over on the server that are conflicting with local folders on developer machines. I am unable to delete these workspaces from the server using tf workspace /server:<server url> /delete <workspace name>;<username> because the owner is listed as Unknown Identity followed by a guid and the command will not accept a wildcard in place of the username. How can I fix this?

    Thanks

     Edit:  The owner accounts were local user accounts on the original TFS server which is why they are now unknown. This server is not in a domain environment.


    Sunday, March 27, 2011 8:42 PM

Answers

  • Assuming that you dont want to write a script to iterate through all the workspaces and call delete with the right guid for each workspace, you could try this approach

    http://davehope.co.uk/Blog/deleting-the-tfs-workspace-for-a-missing-account-fails-tf50605/

     

    DISCLAIMER:Changing the database is not supported

    • Marked as answer by sdfsaasgafg Sunday, March 27, 2011 11:56 PM
    Sunday, March 27, 2011 9:25 PM

All replies

  • Assuming that you dont want to write a script to iterate through all the workspaces and call delete with the right guid for each workspace, you could try this approach

    http://davehope.co.uk/Blog/deleting-the-tfs-workspace-for-a-missing-account-fails-tf50605/

     

    DISCLAIMER:Changing the database is not supported

    • Marked as answer by sdfsaasgafg Sunday, March 27, 2011 11:56 PM
    Sunday, March 27, 2011 9:25 PM
  • Thanks. I was able to locate the problem workspaces and update them with a valid owner. After that the delete command worked.

    Sunday, March 27, 2011 11:59 PM
  • Hi Rob26,

    How can I delete a workspace for a user: Unknown Identity (f79b92ec-11f3-4c81-920a-2244947c7eb3) ?

    I would not like to manually modify TFS database tables.

     

    I have tried:

    tf workspace /server:http://w2k8r2-tfs:8080/tfs/ProjectCollection /delete MyWorkspace;f79b92ec-11f3-4c81-920a-2244947c7eb3

    TF14061: The workspace MyWorkspace;MYDOMAIN\f79b92ec-11f3-4c81-920a-2244947c7eb3 does not exist.

    and

    tf workspace /server:http://w2k8r2-tfs:8080/tfs/ProjectCollection /delete MyWorkspace;"Unknown Identity (f79b92ec-11f3-4c81-920a-2244947c7eb3)"

    TF14061: The workspace MyWorkspace;MYDOMAIN\Unknown Identity (f79b92ec-11f3-4c81-920a-2244947c7eb3) does not exist.

     

    'MyWorkspace' is listed when I do:

    tf workspaces /server:http://w2k8r2-tfs:8080/tfs/ProjectCollection /owner:*



    • Edited by sannagy Monday, July 18, 2011 8:40 AM Added more detail
    Monday, July 18, 2011 8:34 AM
  • Is there a way to use the "tf" command to delete a workspace for an "unknown identity" or no longer existing computer? I have not found any combination that works yet and don't want to modify the database.
    Wednesday, October 26, 2011 4:12 PM