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 exporting a site using stsadm command. It is automatically exporting the subsites too. I need to take the current site only, how can I restrict the subsites?

For example I'm exporting the site, http://site1/subsite1

The subsite1 has 4 child sites. I need to avoid that 4 child sites from that export list.

The command I am using is stsadm -o export -url http://site1/subsite1 -filename c:\backup.cmp

share|improve this question
add comment

3 Answers 3

In scenarios like this, I will export the desired site and it's subsites and import it to a dummy site collection. After it's imported, I delete away the unwanted subsites, export it again, and import it to the final location.

share|improve this answer
    
do you think it is right way. But no problem, i am asking whether it is the functionality of stsadm command. Or there is option for that. –  John Oct 4 '11 at 13:15
    
I don't think there is an option to exclude subsites. –  Kit Menke Oct 4 '11 at 13:21
    
There isn't an option to limit the export to one particular subsite only. It will grab the entire tree of sites from that level down. –  PirateEric Oct 4 '11 at 13:51
    
@ Thanks to all –  John Oct 4 '11 at 14:10
add comment

stsadm cannot do what you are asking unfortunately, however you can achieve the same functionality using SharePoint Designer, which will create a .cmp (which is a cab file by another name) file which you can import using either stsadm or SharePoint Designer as you prefer.

Here are some links to SharePoint Designer as well:

A quick example on how to use SharePoint Designer 2007, to illustrate: Initially go to File > Open Site and you will be presented with a request for either a local directory containing a site or a URL, enter the URL of your SharePoint site.

Once you have done you may have to authenticate, just follow the on-screen prompts, and fill in the details for your admin level account.

Now you can see the Folder List (far left) and Web Site (main part) windows are populated.

Select a site from the Folder List (single left click) then navigate to Site > Administration > Backup Website whereupon you will be presented with a requester again which has a check-box to include sub-sites.

Leave this un-ticked and Voila! you can export a site without its children.

Nice and straight-forward.

share|improve this answer
    
I think more details about how you can create the .cmp with designer would be very helpful :) –  Robert Lindgren Nov 6 '13 at 9:09
    
Ahh sorry:) will add that now:) –  GMasucci Nov 6 '13 at 9:12
    
Great! Now it looks awesome! –  Robert Lindgren Nov 6 '13 at 9:27
    
Cheers by the way, I tend to forget to explain when I am in a hurry, so thanks for the reminder:) –  GMasucci Nov 6 '13 at 9:30
add comment

For Import and Export of a web, list, or library you can use Export-SPWeb and Import-SPWeb

To export use:

Export-SPWeb http://site –Path "site export.cmp"

Then try to import

Import-SPWeb http://site –Path export.cmp –UpdateVersions -Overwrite
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.