Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

http://www.site.com (Root site collection) http://www.site.com/sites/subsiteA (First sub site collection) http://www.site.com/sites/subsiteB (Second sub site collection)

I need command only to take backup and restore the root www.site.com collection without ../subsiteA and ../subsiteB?

share|improve this question
1  
Seems like this is the same question as answered here: sharepoint.stackexchange.com/questions/17671/… –  Steve Lineberry Feb 25 '13 at 19:43
add comment

3 Answers 3

If you are using powershell, you can try:

To export use:

Export-SPWeb http://spsite/SiteA –Path "SiteAexport.cmp"

Then try to import

Import-SPWeb http://spsite/SiteA –Path SiteAexport.cmp –UpdateVersions Overwrite

In addition you can also use spdeploymentwizard.codeplex.com tool to import and export number of SharePoint contents like site collections in your case :)

share|improve this answer
add comment

You can use the Backup-SPSite cmdlet built into SharePoint 2010 and SharePoint 2013, which will only target an individual site collection. In the scenario you're describing, each of those site collections would need to have separate calls of Backup-SPSite in order for them each to be backed up. If you run the command below, it will only target the top-level site collection, which is what you're looking for:

Backup-SPSite -path http://www.site.com 

If you were to want to do site collection backups for each of the site collections, you'd either need to populate an array of the site collections in the web application, or to name them each individually in calls to Backup-SPSite. By default the Backup-SPSite cmdlet will not iterate through each of the site collections beneath the root site colleciton if you pass it the URL for the root site collection.

NOTE: if you're using SharePoint 2007, you'll want to use the Backup operation for STSADM with the -URL parameter populated with the URL of the target site collection.

John

share|improve this answer
    
So, after taking the backup for only site.com top-level sitecollection without subsites. Can I restore it back to one of the subsites in same site collection. For example: site.com/subsiterestore. Could you please let me know the command to restore it or any other command to do it –  4uSharePoint Mar 6 '13 at 18:45
    
I think you're confusing site collections (the SPSite object in the SharePoint Object Model) with subsites (the SPWeb object in the OM). You cannot restore a site collection backup as a subsite because they're not the same type of container. You can restore it to a different site collection within a web application, by using a managed path (site.com/project/siteA instead of site.com), but otherwise you'd have to treat it as a content migration and use the import/export tools instead of the backup/restore tools. –  John Ferringer Mar 16 '13 at 13:15
add comment

/sites/subsiteA and /sites/subsiteB are two completely separate site collections from /, given that /sites/ is a managed path.

Backing up / using Backup-SPSite will therefore not also backup subsiteA and subsiteB.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.