SharePoint: Move a Subsite to Another Site Collection

Disclaimer: This method works well, but I have not researched all of the details of an export -- primarily what's exported, what's not and what are the consequences of using - versions. These are mostly my notes, quick and dirty style.

A task as basic as moving a whole site from one site collection to another should be pretty straightforward, but that doesn't appear to be the case. There may be a few ways to do it, but I'm always partial to STSADM and will be using it for this solution.

First thing is first: stsadm -o backup is not the appropriate command to export a subsite. Backup/restore deals with entire site collections. Export/import deal with sites on a more granular level. If you restore a backup, you will wipe out your entire site collection.

So initially, we exported a site and restored it successfully. First, we created a subsite on the "new" server using the department template. Then we exported and imported.

stsadm -o export -url https://sitecollectionA/indiesite/ -filename c:\subsite.bak stsadm -o import -url https://sitecollectionB/indiesite/ -filename c:\subsite.bak

However, in loading up the site, we were presented with a FILE NOT FOUND error and much of the admin site was broken. Using specific URLs, we could see that the data was there, but it was virtually inaccessible. In looking around, versioning was suggested to be the issue and the following commands were suggested:

stsadm -o export -url https://sitecollectionA/indiesite/ -filename c:\subsite.bak -includeusersecurity -versions 4 stsadm -o import -url https://sitecollectionB/indiesite/ -filename c:\subsite.bak -includeusersecurity -UpdateVersions 2

We deleted the subsite and it's subsites -- because a subsite cannot be deleted if it has its own subsites, using the web interface was going to be tedious, so we just ran the following from the command line.

stsadm -o deleteweb -url https://sitecollectionB/indiesite/subsiteA/supersub stsadm -o deleteweb -url https://sitecollectionB/indiesite/subsiteA stsadm -o deleteweb -url https://sitecollectionB/indiesite/subsiteB stsadm -o deleteweb -url https://sitecollectionB/indiesite/

After the subsite was deleted and recreated using the department template, we ran the export/import with the version info. Unfortunately, we were still faced with the FILE NOT FOUND issue. I'd encountered that error in the past and remembered it to be something simple to fix. Sure enough, we just needed to reapply the master page to the site.

https://sitecollectionB/indiesite/_layouts/settings.aspx -> Look and Feel -> Master Page -> Reset all Subsites to Inherit This System Master Page Setting.

This seemed to do the trick and we proceeded to move several sites in a similar manner.