Here we got a requirement like moving a site collection from one division to another; the simple way to do is STSADM.EXE.
And steps are as follows:
Move Top Level Site to Sub Site
First, I had a top level site in it's own web application that needed to be a sub-site in another web application. I've illustrated in the graphic below. We had to move Site 1 from Site Collection 1 to Site Collection 2.
To export I used:
Next I needed to move a sub site in Site Collection 1 and move it into an empty Web Application 2. In the figure below we had to move Site C from Site Collection 1 to Site Collection 2.
For the export I used:
And steps are as follows:
Move Top Level Site to Sub Site
First, I had a top level site in it's own web application that needed to be a sub-site in another web application. I've illustrated in the graphic below. We had to move Site 1 from Site Collection 1 to Site Collection 2.
To export I used:
- stsadm.exe -o export -url http://Site1 -filename Site1.cab -versions 4
- stsadm.exe -o import -url http://SiteA/Site1 -filename Site1.cab
- If http://SiteA/Site1 already exists when you do you import you may see an error telling you the templates don't match. This means the export site was created using a different template to the one that exists in the new location. To workaround this back up and delete http://SiteA/Site1 then run the import again.
- Any content that hasn't been approved will not be exported by default. I used the -versions 4 switch to export all major, minor and draft versions. You might not need to do this.
Next I needed to move a sub site in Site Collection 1 and move it into an empty Web Application 2. In the figure below we had to move Site C from Site Collection 1 to Site Collection 2.
For the export I used:
- stsadm -o export -url http://SiteA/SiteC -filename SiteC.cab -versions 4
- stsadm.exe -o createsite -url http://SiteC -ownerlogin domain\administrator -owneremail administrator@domain.com -title Site C
- stsadm.exe -o import -url http://SiteC -filename SiteC.cab
- An export should take all content with it.
- Custom features that have been installed on the source server will need to be packaged up and installed on the target before the import will work.
- It does matter which account you use for the export. Strangely, if you don't have the right access the command runs successfully but the export file has got nothing in it. The import doesn't fail either, but you can't find the site you thought you exported. I've tried with an account that had local admin rights and was a site collection admin, but that isn't enough. Always use the farm account.
No comments:
Post a Comment