2

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

3 Answers 3

1

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.

3
  • 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
    Commented Oct 4, 2011 at 13:15
  • I don't think there is an option to exclude subsites.
    – Kit Menke
    Commented Oct 4, 2011 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. Commented Oct 4, 2011 at 13:51
0

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.

4
  • I think more details about how you can create the .cmp with designer would be very helpful :) Commented Nov 6, 2013 at 9:09
  • Ahh sorry:) will add that now:)
    – GMasucci
    Commented Nov 6, 2013 at 9:12
  • Great! Now it looks awesome! Commented Nov 6, 2013 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
    Commented Nov 6, 2013 at 9:30
-1

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

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.