1

When I was adding a project collection to TFS it crashed mid way. It did not create the database for the collection. The collection shows in the TFS Admin Console, but it won't let me detach it because it says

TF246017: Team Foundation Server could not connect to the database. Verify that the server that is hosting the database is operational, and that network problems are not blocking communication with the server.

How do i get rid of this ghost collection?

4 Answers 4

1

Try repairing the db

dbcc checkdb ('TfsVersionControl',repair)

as found on: http://dotnet.dzone.com/news/database-corruption-tfs-2005?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fcss+%28CSS+Zone%29

1
  • CHECKDB found 0 allocation errors and 0 consistency errors in database. Nov 4, 2010 at 19:52
1

The best option is to delete the collection using below command.

syntax:TFSConfig Collection /delete /collectionName:[COLLECTION NAME]
TFSConfig Collection /delete /collectionName:Project( here project is name of the collection)

For example:

C:\Users> cd..

C:\> cd Program Files\Microsoft Team Foundation Server 2010\Tools

C:\Program Files\Microsoft Team Foundation Server 2010\Tools> TFSConfig Collection /delete /collectionName:Project
Logging sent to file C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_TPC_AT_0710_134506.log
Command: collection
TfsConfig - Team Foundation Server Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.
Deleting a Team Project Collection is an irreversible operation. A deleted collection can not be reattached to the same or another Team Foundation Server. Are you sure you want to delete 'Project'? (Yes/No) y
Found Collection 'Project'. Deleting...
The delete of collection 'Project' succeeded.
0

This worked for me...

 1. Actions to perform on TFS 2010
   1.1 Using the TFS console "Detach" the collection from the "TFS server"

   1.2 Using the SQl Manager "Detach" the database for the corresponding TFS 
       collection



 2.  Actions to perform on TFS 2012
   2.1 Using the SQl Manager "attach" the database for the corresponding TFS 
       collection

   2.2 Make sure to give the TFS user account/s access to the database otherwise 
       the TFS server will not be able to access it.

   2.3 Using the TFS console "attach" the collection to the "TFS server"
0

I'm not sure if it will have any side effect but I had this same problem and I solved it deleting the row in the table tbl_Database of the Tfs_Configuration database that is pointing to the missing database through the ConnectionString field.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .