Archive

Archive for January, 2010

TFS 2008 – Project deleted but SharePoint side failed to be deleted

January 11th, 2010 Patrick 1 comment

I tried to use TFSDeleteProject command to remove the project from the TFS server,

tfsdeleteproject /server:myserver myprojectname

but at the end of the process there is this error message

Deleting from Build …
Done
Deleting from Work Item Tracking …
Done
Deleting from Version Control …
Done
Deleting Report Server files …
Done
Deleting SharePoint site …
Could not connect to ‘
http://TFS08:17012/_vti_adm/admin.asmx’
The request failed with the error message:

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="
http://tfs08:17012/_layouts/1033/error.aspx?ErrorTe
xt=Request%20timed%20out%2E">here</a>.</h2>
</body></html>

Then I tried to repeat the command again with the /force option (tfsdeleteproject /force /server:myserver myprojectname), I still get the error

Deleting from Build …
Done
Deleting from Work Item Tracking …
Done
Deleting from Version Control …
  Not found
Deleting Report Server files …
  Not found
Deleting SharePoint site …
Exception of type ‘Microsoft.SharePoint.SoapServer.SoapServerException’ was thro
wn.
Deleting from Team Foundation Core …
Done

But actually what happened is everything within TFS have been safely removed except the SharePoint, so you need to go into SQL Server Management Studio and connect to WSS_Config database

Select Id From Sitemap Where Path = ‘/Sites/myprojectname’

Grab the Id and execute this SQL

exec dbo.proc_dropSiteMap @Id=%Id%

After that you still need to clean up your WSS_Content database by executing this

exec proc_DeleteSite %Id%

But do note you might have nothing to delete in the WSS_Content