SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 being exported?

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

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. – Eric Alexander Oct 4 '11 at 13:51
@ Thanks to all – John Oct 4 '11 at 14:10

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

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

Your Answer


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.