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

Is there are way to run the Export-SPSite command without exporting sub-sites? I just want to export the parent site from a web app, but there are about 120 sub-sites in the site collection that I want to skip.

share|improve this question
add comment

2 Answers

I think you mean Export-SPWeb: http://technet.microsoft.com/en-us/library/ff607895.aspx. It does not have a switch for excluding subsites.

The other options for export are the SPExport class in the Microsoft.SharePoint.Deployment, but unfortunately the SPExportSettings object doesn't have a way to exclude subsites...not sure why it doesn't when the Sites Web Services ExportWeb method does support it...

The ExportWeb method of the Sites Web Services has a parameter to IncludeSubWebs: http://msdn.microsoft.com/en-us/library/websvcsites.sites.exportweb.aspx. And it works (...just set it to False)...we tried all these different methods when we were StoragePoint testing to determine how the OOB capabilities handled remoted BLOBS.

share|improve this answer
add comment

The SPExportSettings of the SPExport object has an obscure ExportObjects property that is used to control if subwebs are included or not. Adding SPIncudeDecendants.Content will exlude subwebs. See for example: http://www.codeproject.com/Articles/72521/Using-SPExport-and-SPImport-Part-1

It seems that the Export-SPWeb cmdlet does not expose ExportObjects, still you can use the object model directly in powershell like this: http://shannonbray.wordpress.com/2010/06/26/moving-sharepoint-2007-sites-to-another-environment-with-powershell/

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.