Delete Orphaned Sites in SharePoint
So I ran into an issue the other day with deleting a SharePoint site. I needed to delete a site and re-create it because of our migration. To do this I went to Site Setting on the specific site and deleted it from the web browser. I have done this before with this site because I needed to practice the migration, no issues before. This time although the server was moving slow, and because of this it just continued to try and delete the site with no confirmation page that it was successful. The page was gone so I thought all was well. This was until I saw errors coming from the server logs relating to the page I had deleted! I looked in the Central Administration page to check the site list, the site was still there! I clicked to delete the site from the Central Administration page but it would not work, no option to delete. I then tried to delete the site with STSADM.EXE but I got this error with both stsadm.exe -o deletesite and stsadm.exe -o deleteweb: The system cannot find the path specified. (Exception from HRESULT: 0×80070003). I searched this error on the internet and found a solution which did finally work.
Go here for the Microsoft solution: http://support.microsoft.com/default.aspx?scid=kb;EN-US;918744
I did the following.
Step 1: I opened a Command Prompt and went to this directory: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
I typed in the following to list the orphaned sites:
stsadm -o databaserepair -url http://URLofWindowsSharePointServicesSite -databasename DatabaseName
I then typed the following to delete the orphaned sites:
stsadm -o databaserepair -url http://URLofWindowsSharePointServicesSite -databasename DatabaseName -deletecorruption
This didn’t harm anything but didn’t seem to do anything either. Since I did preform this step I cannot say it didn’t help and I can’t say it did, so i would do it just in case.
Step 2: This was the final step that did fix the issue. Remove and then reattach the content databases on the virtual server. I am quoting this from Microsoft:
1. Click Start, click Administrative Tools, and then click SharePoint Central Administration.
2. Under Virtual Server Configuration on the Windows SharePoint Services Central Administration page, click Configure virtual server settings.
3. Click the virtual server that you want to configure, and then click Manage content databases under Virtual Server Management on the Virtual Server Settings page.
4. On the Manage Content Databases page, click the content database that you want to remove.
5. On the Manage Content Database Settings page, note the following settings:
• The database server
• The database name
• The database capacity settings
6. Click to select the Remove content database check box, and then click OK. When you are prompted to confirm that you want to remove the content database, click OK.
7. Click OK.
8. On the Manage Content Databases page, click Add a content database.
9. On the Add a Content Database page, specify the database server, the database name, and the database capacity settings. Then, click OK.
I hope this helps. It worked for me. The sites were gone completely and I was able to create the new site with the old name.
- Kevin C -
Recent Comments