Link to home
Start Free TrialLog in
Avatar of skbarnard
skbarnard

asked on

Delete a site collection Sharepoint 2010

We needed to move a couple of site collections under a different department as we've had a restructure of management at my business.
I found this pretty cool tool that will essentially run the STSADM commands in the background through a GUI-type interface.
However, it essentially copies the site from one location to the other so I need to delete the site collection from the old location.
I tried to do that by clicking on "delete this site collection" from the "Site Actions" area under "Site Settings" but I get an error.  When I try to delete the site collection, I get the error stating I couldn't delete the site if there were sub-sites. There is a calendar associated with this site collection that I believe is causing the above error.  When I click on the calendar link to get to that sub-site, I get an error that it can't find a file and the site won't even open (I've attached a screen print of the error)
The file it's looking for is a 3rd party add-on that was installed on our Sharepoint 2007 setup.  When we upgraded to Sharepoint 2010, this product hasn't been installed but apparently a remnant still exists.
Can anyone give a STSADM or POWERSHELL command that will delete that file remnant so I can delete the site I need to delete?  Am I going to have to install that 3rd party product just to be able to delete this site collection? (I hope not)
SharepointFileError.pdf
Avatar of dp_expert
dp_expert
Flag of Poland image

Have you tried to delete this site collection from central administration? I will allow you to delete entire site collection with subsites.
stsadm -o deletesite -url http://servername/sites/sitename
Avatar of skbarnard
skbarnard

ASKER

I have tried to delete the site from Central admin, I get the message the site isn't found.
The site was copied to its new location under a different department so when I try to find it under the old department, it says "No site was found that begins with /Departments/DepartmentName/SubDepartment" (SubDepartment is the actual site collection I'm trying to delete - not the actual name)

I tried using the STSADM command above from martusha and I get the message "there is no top level web site named http://servername:port/site/sitename" (I filled in the appropriate information)  I tried the command with & without the port, got the same error each time

I need to move one other site collection from the discontinued site then I may be able to do what dp_expert suggested as there would then be no viable sub-sites under this department.

I'll report back - unless either of you can address the error message I recieve.
UPDATE ----
When I go to Central Admin, View all site collections - I'm unable to see all the site collections.
With our MOSS 2007 setup when I clicked on view all site collections, I could get a tree view and see top-level "portal", then see "departments" and under departments all sub-departments etc.  For instance Portal -> Departments -> BusinessOffice -> Insurance etc.
In the attached file, you can see what I see.  I've already chosen the top level site (Portal) and all I see then is the yellow area with the /.  So in the URL search area, I put the rest of the path (Departments/DeputySup/IS) and I get the error shown.
I even tried the whole URL http://portal.company.com/Departments/DeputySup/IS and get the same error message.
Any thoughts?
I can't backup the site through Central Admin because I can't see all of the site collections.
My system doesn't seem to recognize the backup command in STSADM.
I tried using the following PS command - it appears to need or want more information because as soon as I press return, I get a >> prompt
Backup-SPSite -Identity "http://TopLevelSite.company.com/Departments/NextLevel/CollectionWantToBackUp" -Path "C:\folder\filename" (this was entered on one line in PS, it was changed when typed into this message box)
SharepointError3-27.pdf
Let me get this straight - you can acces the site by going to it with URL but cannot see it in the central admin?

Are you using correct web application? When you choose site collections you are give also a field (partly visible on your screenshot in the top right corner) to choose the web app.
I usually take the long way to get to the site by going to the portal home page then click on the department, then the site.
However, I just tried navigating to the site directly by typing in the whole URL and YES - I can navigate to the site directly in the browser but when I try to see it in Central Admin, the site isn't found.
I have selected the correct web app (our portal web app) and under that I should be able to see a list of all the subsites under that web app, right?
Under web application you should be able to see all available Site Collections (not subsites).
Maybe you want to delete a site, not a site collection?
The view is being paged, so if you have a lot of site collections there might be some on other pages. But something struck me  - on the screenshot you have submitted you have only one site collection - the root one.

Are you sure you have multiple site collections? Because site collection is not just a set of sites but also an object in SharePoint.

If by site collection you mean a subsite and multiple subsites of this subsite, then this is not a site collection - just a collection of sites - and it's a very important distinction.

What do you see in the central admin when you go to "Application management" then "View all site collections" under the "Site collections" group? Only one entry with a "Slash" (first example on the attachment) or multiple entries (second example) ?
User generated image
If only one entry this means you have only one site collection. In this case go to the site you want to delete. There click "Site actions" and choose "Site settings" (you should get to http://portal.company.com/Departments/DeputySup/IS/_layoouts/settings.aspx) On the site settings page click "Sites and Workspaces" (should show you the "http://portal.company.com/Departments/DeputySup/IS/_layouts/mngsubwebs.aspx" page) - there you will be able to delete the subsites of the current site. Once this list is empty you will be able to delete this current site.
When I go to the proper web application (portal.comany.com), I see what you show in the top picture - one entry with a slash, but I should see what is pictured in your second picture.
I will eventually want to delete the site (martusha) but I continue to get the message
"Error deleting Web site "/Departments/DeputySup/Facilities". You can't delete a site that has subsites"
I get this error when I'm actually trying to delete the Facilities sub-site (site collection) that has already been copied to its new location.  That site collection has a calendar under "sites" that when I try to delete it, I get an error stating a file can't be found (from a 3rd party add-on that was part of our 2007 setup but never installed when we upgraded to 2010)  I get the error when I try to go to the facilities calendar page.  
In other words, I've tried everything that you mentioned, dp_expert but none of it has worked.
I've also tried "remove-spsite" PS command to no avail.
ASKER CERTIFIED SOLUTION
Avatar of martusha
martusha
Flag of Lithuania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cool tool - it enabled me to delete the site (and find that the site was under multiple departments!)
Yes, its really nice. Happy to hear that it helped you.
Thanks!