0

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?

1

3 Answers 3

1

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 :)

0

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

2
  • 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 Commented Mar 6, 2013 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. Commented Mar 16, 2013 at 13:15
0

/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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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