locked
Accidental Collection Database Delete - How to Remove Collection? RRS feed

  • Question

  • We had a SQL Server admin go ahead and delete a team project collection database directly from SQL. He was trying to clean up the TPC databases we used for testing. Unfortunately he deleted (used close existing connections) one of the database for a TPC that wasn't already detached from the TFS Administrative console.

    Now we can't detach the unused TPC because it says there is a SQL server database issue (yes the db no longer exists).

    I've tried creating a new TPC and attaching the old TPC (the one that needs to be deleted) to the database of the new TPC (just so I can delete it) and I'm getting the following error:

    TF252035 - The modification you made to the connection string is not valid. The connection string does not point to a database with the correct collection stamp. Verify that the connection string is correct and points to the correct database for the team project collection.

    How can I remove/detach a TPC that has already had it's database deleted?

    Monday, September 13, 2010 9:12 AM

Answers

  • Hi Allen,

    You can use TFSConfig Collection /delete /CollectionName:yourcollectionname to permanently your team project collection from a deplyment of the Team Foundation Server. After you execute the command successfully, the team project collection will be detached from the TFS.

    Then you need to delete the team project collection site from the sharepoint:

    Open SharePoint Central Administration, and delete the site collection that supported the deleted collection.

    For more information, see the following page on the Microsoft Web site: Delete a Site Collection (Windows SharePoint Services 3.0) or Delete a Site Collection (Microsoft Office SharePoint Server 2007). 

    When you create a new team project collection with the same name, you need specify another report location for TFS during the creating the collection.

    Hope it helps!

    If you have any concern, please feel free to let me know!

    Best Regards,

    Cathy Kong

    Wednesday, September 15, 2010 7:13 AM
    Moderator
  • Cathy,

    I just remember my old DOS days and just put " " around my collection name and it succeeded.

     

    Thanks for a great post!

     


    Tony Spaulding
    Tuesday, November 30, 2010 4:17 PM

All replies

  • Hi Allen,

    You can use TFSConfig Collection /delete /CollectionName:yourcollectionname to permanently your team project collection from a deplyment of the Team Foundation Server. After you execute the command successfully, the team project collection will be detached from the TFS.

    Then you need to delete the team project collection site from the sharepoint:

    Open SharePoint Central Administration, and delete the site collection that supported the deleted collection.

    For more information, see the following page on the Microsoft Web site: Delete a Site Collection (Windows SharePoint Services 3.0) or Delete a Site Collection (Microsoft Office SharePoint Server 2007). 

    When you create a new team project collection with the same name, you need specify another report location for TFS during the creating the collection.

    Hope it helps!

    If you have any concern, please feel free to let me know!

    Best Regards,

    Cathy Kong

    Wednesday, September 15, 2010 7:13 AM
    Moderator
  • Hi Allen,

    Is your issue solved?

    I am marking the reply as answer, if you have any concern, please feel free to unmark it and let me know!

    Best Regards,

    Cathy Kong

    Monday, September 20, 2010 1:37 AM
    Moderator
  • Cathy,

    I am having the exact same issue and attempted to delete my collection via the TFSConfig tool.  I am having issues because my collection is called Primary Collection (with a space).  When attempting to run the delete command i am getting this error.  "This command does not accept any free arguments"

    Is there still a way to delete this collection from TFS?

     

    Thanks for your help!

    Tony Spaulding


    Tony Spaulding
    Tuesday, November 30, 2010 4:15 PM
  • Cathy,

    I just remember my old DOS days and just put " " around my collection name and it succeeded.

     

    Thanks for a great post!

     


    Tony Spaulding
    Tuesday, November 30, 2010 4:17 PM
  • Happy to hear it works with "" (quotes). Quotes are the saviour with tf commands.

    Tuesday, November 30, 2010 4:29 PM
  • Hi Tony,

    Thanks for sharing the method!

    Best Regards,

    Cathy

    Wednesday, December 1, 2010 2:14 AM
    Moderator
  • Question:


    When the collection is deleted with the above command that works with "" in my case as well.

    The SQL Server database is still located on the SQL Server.

    Why is it not removed when deleting the collection?

    I guess manual deletion of the left over database is OK?



    Regards

     

    Henrik Sjöberg IT Pro
    Logica ECM


    Sharepoint/DPM2010 Consultant
    Friday, May 6, 2011 1:09 PM
  • When reading this thread, I have similar question too.  I just happened to delete DB from SQl server, and how do I remove team project collection and sharepoint web application... Etc.. without the the database.  Thanks.

     

     

    Wednesday, December 7, 2011 12:50 AM
  • Will not work on TFS 2013 Update 2.
    Friday, May 16, 2014 9:28 AM
  • thanks alot,its worked for me

    Monday, January 4, 2016 7:03 AM
  • Cathy,

    I just remember my old DOS days and just put " " around my collection name and it succeeded.

     

    Thanks for a great post!

     


    Tony Spaulding

    thanks alot

    Monday, January 4, 2016 7:11 AM