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

I am looking for a quick way to export all sub-sites from a web application and exclude the root url, is there a quick way to accomplish this?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

maybe this can help :

Get-SPSite http://yourwabapp/sites/sitecol | Get-SPWeb | Where-Object  { $_.ParentWeb -Ne $null } | ForEach-Object { Export-SPWeb -Identity $_ -Path $_.ID }

you will need to adjust the export params according your needs

share|improve this answer
    
great thanks this works, is there a way to make it a single export or does it need to export each subsite individually? –  Adonis L Jun 29 '11 at 11:24
    
I would need to import the sites as well as there are a lot, i would like to do it with a single import command –  Adonis L Jun 29 '11 at 11:32
    
Just loop through the exported sites using PowerShell, and import each one. Something like dir $folderpath | For-Each {Import-SPWeb -Path $_.FullName -(Additional import parameters...) –  tarjeieo Jun 29 '11 at 12:34
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.