Personal Web & Sample Site
Skip Navigation Links
HOME |
About Me |
Articles
| Contact Us
Moving Sub Sites Using STSADM
Rating: 28 user(s) have rated this article Average rating: 5.0
Posted by: admin, on 10/11/2012, in category "SharePoint"
Views: this article has been read 5045 times
Location: Houston, Tx, United States
Abstract: I do remember this being a hot topic a few years ago. Many of the people I talked to that asked if it was possible to move sub sites in a site collection to another site collection thought it couldn’t be done. They’re wrong! You can use the export and import operations that also include several parameters, to move items or objects underneath a site collection to another site collection.

 

Note: (Always perform a complete backup before performing any of these tasks)

I was tasked to move a total of 18 sub sites to a new domain. The MOSS2007 implementation had two web applications with different domain names.

  • SharePointSite1  - 80 | http://site1.sitecollection.com
  • SharePointSite2  - 80 | http://site2.sitecollection.com

I had to move 18 sub sites from SharePoint2  to SharePointSite1.  

SharePointSite1 did not have a root site collection. All 18 sites had a different taxonomy that needed to be replicated underneath SharePointSite1 in the following manner:

  • http://SharePointSite1/subsite1/
  • http://SharePointSite/subsite1/subsite2/

 http://site1.sitecollection.com/subsite1 (sub site1 site needs to be created in Central Administration as a site collection).

The first step was to create “sub site1” under the root site at http://site1.sitecollection.com. This was not an easy task as there was no root site collection at this address and it was being used as a redirect to http://site2.sitecollection.com.  I had to create a wild card inclusion in order to select the root as the location for creating the sub site1.

Steps:

  1. Make sure you have selected the correct web application http://site1.sitecollection.com.

  2. Under “SharePoint Web Application Management” click “Define managed paths” and delete the root explicit inclusion.

  3. Then go back and create a wildcard inclusion for the root (This will break the redirect so quickly create your new sub site).

  4. Go back to “Application Management” and under “SharePoint Site Management” and click “Create site collection”.

  5. Make sure you have the right web application selected and create the new site using the team site template.

  6. Now go back to “Define managed paths” and delete the root wildcard inclusion and put the root explicit inclusion back.

  7. Now you should be able to navigate to http://site1.sitecollection.com/subsite1 and create the other sub site “Sub site2”.

  8. After creating “Sub site1”, you can begin exporting and importing your sub sites.

These next steps on the list are to move all sub sites listed.

Backup and restore is for Site Collections and export and import are for items underneath a site collection.

Steps:

  1. Navigate to http://site1.sitecollection.com/sub site1 and create the “Sub site2” sub site.

  2. Fire up stsadm.exe type the following command to export sub sites to a file share folder of your choice. (all on one line of course)

  3. Stsadm.exe –o export  –url http://site2.sitecollection.com/sub site1/MoveSite1  -includeusersecurity –filename C:\exportSites\ONE\MoveSite1\movesite1

  4. Includeusersecurity is optional but do not use it, unless you plan on overwritting or exporting the entire security model for the site collection. If you know the site has a large content file then use the -nofilecompresson and only create the folder (for compressed files) but if not, be sure to include a name for the .cmp file that will be written to the folder “MoveSite1”.

For me my task listed numbered groups of sub sites so I created a folder for each numbered group to put my export files into e.g. 1,2,3,4, but of course you can organize however you like. Once you have exported all of the sub sites, you are then ready to begin the import operation.

At first I thought you had to create a blank site on the destination sub site but you don't need to. Actually, I would recommend not doing so because when I did it this way I had some problems. By listing the site name in import operation it created the sub site for me and worked perfectly every time.

Type the following:

Stsadm.exe –o import –url http://site1.sitecollection.com/sub site1/MoveSite1 -includeusersecurity -filename C:\exportSites\ONE\MoveSite1\movesite1.cmp

That’s it!

Also, make it a point to avoid mistakes and having to delete any sub sites. This will create orphan sites and you'll have to deal with this during migration to 2010.

Here is the link to the import operation on Technet’s website.

http://technet.microsoft.com/en-us/library/cc261866(v=office.12).aspx

I hope this helps....

 


How would you rate this article?

User Feedback
Comment posted by dropkic on Thursday, January 31, 2013 8:49 PM
Not a bad article!

Post your comment
Name:
E-mail:
Comment:
Insert Cancel

Copyright © 2013 Jose M. Tamez
Last Updated August 18th 2013