Please upgrade your web browser now. Internet Explorer 6 is no longer supported.
Thinking Web Solutions?
We create smart, fun, functional websites that make your web a better place.

Move a WSS sub site to the top level

Had a situation recently where I needed to promote a subsite to a top level site. As STSADM backup/restore can only be used at the site collection level, a different approach was required.
As of WSS v3, there are two new STSADM commands - import and export.
The basic procedure to promote the subsite was to STSADM export the site to a file and then STSADM import it at the toplevel.
Here are the basic commands I used:

Export subsite

stsadm -o export -url http://toplevel/subsite -filename c:\subsite.bak -includeusersecurity -versions 4

Import subsite

stsadm -o import -url http://toplevel/ -filename c:\subsite.bak -includeusersecurity

A couple of things to note:

The -includeusersecurity switch ensures that all the columns such as modifed by, created by are maintained.
The -versions 4 switch will ensure that all versions of list items/documents are exported.
You must import/export to sites that share the same template. So a team site can only be exported and imported into another team site. You will know you are trying to import into non matching templates if you get the following error:
"The exported site is based on the template STS#1 but the destination site is based on the template STS#0"
This means that a site based on the blank template is trying to be imported into a site based on the team template. To my knowledge there is no easy way of changing a sites templates.

The following lists some of the common WSS templates:
Team Site STS#0
Blank Site STS#1
Document Workspace STS#2
Wiki Site WIKI#0
Blog BLOG#0
If you want to know more there is a wealth of information on a blog post by Jackie Bodines.

1 comment for “Move a WSS sub site to the top level”

  1. Trey  6/28/2007

    Zac- Dumb question here. I am simply trying to export a top-level site. Just export it. Only it. Not the webs beneath it. I could have sworn SUSHI (codeplex) was doing this before for me, and I know it only uses STSADM commands. But when I run it, it exports the entire webs collection from http://mysite/ down. When I run the STSADM command: stsadm -o export -url "http://mysite" -filename "c:\mysite_export.cab" it also exports the whole thing. isn't there a way to simply export a single web without considering its parent or child webs? Thanks, -Trey

Post a comment