locked
How to delete a collection without related database connected (TFS 2013 Update 2)

    Question

  • After the database of collection are deleted by accident, the collection item is still existed in TFS.

    I've tried:

    1 Use TFSConfig.exe like TFS 2012. Failed: The detach operation failed. Don't have a way to do that as before.

    2 Use the database from a new created collection from another TFS server with same name. Failed: TF400876: Could not find the partition for host bb1198c1-d2f9-487b-89b6-ae097b4f2dc6.

    How to delete that then? Have to reinstall the whole TFS?

    Saturday, May 17, 2014 11:45 AM

Answers

  • Hi EternalSnow,

    Thanks for your reply.

    My last reply not use to clean the cache.

    I want to confirm with you that: if all other collections can be detached from TFS Admin Console successfully. I think you can move all your normal collections to a new TFS 2013 Update 2 Server. After moved to the new TFS 2013 Update 2 Server successfully, you can close this current TFS 2013.2 server.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by EternalSnow Wednesday, May 21, 2014 3:58 AM
    Tuesday, May 20, 2014 2:14 AM
    Moderator

All replies

  • You need to go into the Tfs_Configuration database directly and remove it.  In that database, there is a table called tbl_Database.  Remove the record that points to the collection that needs to be removed.  As with any manual change to any database records, make sure you backup of all the databases first using the built-in tool in the Tfs administration console.
    Saturday, May 17, 2014 10:07 PM
  • After delete that record (id=29), TFS console cannot list any collection.

    TF400579: Could not find a database with DatabaseId: 29.

    When click Refresh:

    TF254029: An error occurred while the action that you specified was being performed.
    Sunday, May 18, 2014 4:01 AM
  • Also delete it from tbl_ServiceHost.  Also, make sure the HostId guid for that row is not in any of the following tables.  Most likely it is not.

    tbl_AccountHostMapping
    tbl_DataExport
    tbl_DataMigration
    tbl_HostDeletion
    tbl_NotificationQueue
    tbl_QuotaValues
    tbl_ServiceHost
    tbl_ServiceHostInstance
    tbl_ServicingJobDetail

    • Marked as answer by EternalSnow Sunday, May 18, 2014 5:07 AM
    • Unmarked as answer by EternalSnow Monday, May 19, 2014 2:41 AM
    Sunday, May 18, 2014 4:19 AM
  • I've restored the Tfs_Configuration database to the version before creating that collection. After get backup creating time, only the affected collection created and one project is created and removed later within another collection. But there are many changesets are submitted to many projects except that collection and project I mentioned above.

    Is that acceptable? Just restore the configuration database only, not all databases.

    Thanks.



    Sunday, May 18, 2014 4:31 AM
  • You should restore the all of the collection databases and Tfs_Warehouse from that backup.  If they are out of sync, it may be corrupted.  Backup and restores should be done from marked transactions to make sure they are at the same point in time.
    Sunday, May 18, 2014 4:55 AM
  • It's impossible to restore Tfs_Warehouse with Configuration database. May changesets are submitted.

    Turn to remove records from the Configuration...

    There is no record in such tables:

    tbl_AccountHostMapping
    tbl_DataExport
    tbl_DataMigration
    tbl_HostDeletion
    tbl_QuotaValues

    There is no relevant record in such tables:

    tbl_NotificationQueue
    tbl_ServiceHost

    Records matched are deleted from such tables:

    tbl_ServiceHostInstance
    tbl_ServicingJobDetail

    Seems succeeded.

    Sunday, May 18, 2014 4:58 AM
  • Sorry but editing the TFS Databases is not supported!!!You lose the complete support!

    Please open a support ticket http://support.microsoft.com/ph/1117

    Regards,

    Daniel

    Sunday, May 18, 2014 7:44 AM
  • Also delete it from tbl_ServiceHost.  Also, make sure the HostId guid for that row is not in any of the following tables.  Most likely it is not.

    tbl_AccountHostMapping
    tbl_DataExport
    tbl_DataMigration
    tbl_HostDeletion
    tbl_NotificationQueue
    tbl_QuotaValues
    tbl_ServiceHost
    tbl_ServiceHostInstance
    tbl_ServicingJobDetail

    Sorry but editing the TFS Databases is not supported!!!You lose the complete support!

    Please open a support ticket http://support.microsoft.com/ph/1117

    Regards,

    Daniel


    Sunday, May 18, 2014 7:46 AM
  • My company is using TFS and become a customer of Microsoft since 2003. There are many tech issues but NONE of them are solved by Microsoft support ticket.

    I have many opened issues there. Some of them (SharePoint related) last for more than 1 year. And, before I start this topic, I've fired a ticket to Microsoft Connect also a day ago. As usual, none of response received.

    I believe this forum better than those help desks.

    Anyway, thanks for your info. I will setup a new TFS and migrate all warehouses when next version launched lol.


    Sunday, May 18, 2014 7:48 AM
  • to me it does not matter but if you raise a support ticket and the support sees that you changed something in your database.. then you have to pay for the support and you will lose the complete ms support... your decision ;-)


    Sunday, May 18, 2014 8:55 AM
  • Actually after remove from these tables, the VS client still can get that collection listed. But not the TFS Admin Console.
    Monday, May 19, 2014 2:42 AM
  • Hi EternalSnow, 

    Thanks for your post.

    As Daniel said, we don’t recommend edit the TFS databases directly, it may cause the unknown issues.

    If  there’s a full back up before deleted that collection(backup time very near the delete operation time), we suggest you restore that full back up to your TFS Server. Note: you need make the full back up before any operation(upgrade/move…) on your TFS databases.  

    For your current issue, if the VS still get the collection listed, try to remove that collection from the Server List. And try to clean the Cache on your client manually(delete the content of the folder only, not the cache folder itself), the folder path is: C:\Users\username(Team Explorer user name)\AppData\Local\Microsoft\Team Foundation\5.0\Cache.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 19, 2014 5:41 AM
    Moderator
  • I found there are many related records in tbl_CatalogResource / Node (based on the id tbl_CatalogResource).

    I will detach all collections, redeploy the whole TFS database by creating a new configuration database, and attach collections back again. Does that work?

    Thanks.

    Monday, May 19, 2014 8:14 AM
  • Hi Eternal Snow,

    Thanks for your reply.

    Yes, I think you can do that.

    Don’t forget make full back up for your current TFS Server.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 19, 2014 8:20 AM
    Moderator
  • Clearing your Team Explorer cache will remove it.  Go to C:\Users\<userName>\AppData\Local\Microsoft\Team Foundation\5.0\Cache and clear it out.  First close VS.
    Monday, May 19, 2014 2:19 PM
  • it's done and not help to fix.
    Monday, May 19, 2014 2:19 PM
  • Hi EternalSnow, 

    Thanks for your reply.

    You can detach your current “normal” collections from TFS Admin Console?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 20, 2014 2:03 AM
    Moderator
  • Hi EternalSnow, 

    Thanks for your reply.

    You can detach your current “normal” collections from TFS Admin Console?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thanks for your reply.

    1 The reply "not help" is for cleaning cache.

    2 All others collections can be detached normally and the jobs are scheduled for our next maintenance. I have to wait for our CM officer to make sure all changesets are checked-in.

    I will reply the result here.

    Tuesday, May 20, 2014 2:07 AM
  • Hi EternalSnow,

    Thanks for your reply.

    My last reply not use to clean the cache.

    I want to confirm with you that: if all other collections can be detached from TFS Admin Console successfully. I think you can move all your normal collections to a new TFS 2013 Update 2 Server. After moved to the new TFS 2013 Update 2 Server successfully, you can close this current TFS 2013.2 server.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by EternalSnow Wednesday, May 21, 2014 3:58 AM
    Tuesday, May 20, 2014 2:14 AM
    Moderator
  • Hi EternalSnow,

    Thanks for your reply.

    My last reply not use to clean the cache.

    I want to confirm with you that: if all other collections can be detached from TFS Admin Console successfully. I think you can move all your normal collections to a new TFS 2013 Update 2 Server. After moved to the new TFS 2013 Update 2 Server successfully, you can close this current TFS 2013.2 server.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    It's fixed by:

    1 Detaching all collections;

    2 Remove installed TFS Feature;

    3 Delete Configuration database;

    4 Deploy a new TFS instance;

    5 Attach all collections back.

    The funny thing is the wizard for attaching is not well designed by attaching multiple collections. When I select a collection and click next, an error message box is shown up to let me confirm the database is backed up but I don't know how to do that. There is a checkbox "I confirm that I have a current backup" below but it's needed to scroll down to show coz too many databases listed above.

    Thanks everyone here again. 

    Wednesday, May 21, 2014 3:56 AM