Environment: SharePoint 2007/2010/2013
Requirement: To move a site collection as a subsite to another site collection, we can make use of STSADM or Powershell import/export command.
Following are the steps to achieve this
Assume that, we need to move the site collection http://sitecollection1/sites/asite to another site collection http://sitecollection2/sites/bsite as a subsite.
Steps
1. Export the site collection (http://sitecollection1/sites/asite) using STSADM command line tool
using stsadm command
stsadm.exe -o export -url http://sitecollection1/sites/asite -filename c:\backups\sc_asite.bak –includeusersecurity –nofilecompression
using powershell
Export-SPWeb -Identity http://sitecollection1/sites/asite -Path C:\backups\sc_asite.bak -IncludeUserSecurity -NoFileCompression
2. Create a new site with Blank Site template in the other site collection (http://sitecollection2/sites/bsite). Assume the blank site name is csite
3. Import the backed up site collection in c:\mybckup\sc_asite.bak
using stsadm command
stsadm.exe -o import -url http://sitecollection2/sites/bsite/csite -filename c:\backups\sc_asite.bak
-includeusersecurity -nofilecompression
using powershell
Import-SPWeb http://sitecollection2/sites/bsite/csite -Path c:\backups\sc_asite.bak -IncludeUserSecurity -NoFileCompression
After migration, the site collection 1 will be available under the following URL as a subsite http://sitecollection2/sites/bsite/csite
Requirement: To move a site collection as a subsite to another site collection, we can make use of STSADM or Powershell import/export command.
Following are the steps to achieve this
Assume that, we need to move the site collection http://sitecollection1/sites/asite to another site collection http://sitecollection2/sites/bsite as a subsite.
Steps
1. Export the site collection (http://sitecollection1/sites/asite) using STSADM command line tool
using stsadm command
stsadm.exe -o export -url http://sitecollection1/sites/asite -filename c:\backups\sc_asite.bak –includeusersecurity –nofilecompression
using powershell
Export-SPWeb -Identity http://sitecollection1/sites/asite -Path C:\backups\sc_asite.bak -IncludeUserSecurity -NoFileCompression
2. Create a new site with Blank Site template in the other site collection (http://sitecollection2/sites/bsite). Assume the blank site name is csite
3. Import the backed up site collection in c:\mybckup\sc_asite.bak
using stsadm command
stsadm.exe -o import -url http://sitecollection2/sites/bsite/csite -filename c:\backups\sc_asite.bak
-includeusersecurity -nofilecompression
using powershell
Import-SPWeb http://sitecollection2/sites/bsite/csite -Path c:\backups\sc_asite.bak -IncludeUserSecurity -NoFileCompression
After migration, the site collection 1 will be available under the following URL as a subsite http://sitecollection2/sites/bsite/csite
Hi Thanks for this really pointed me in the right direction,i added a few other operations on the command. Just a quick note that the export line on our server was being strict and i had to add the .exe after stsadm. Id hate for people to take away from this useful post just cos they didnt exercise a bit of common sense on the export routine!! Thanks :-)
ReplyDeleteThank you Glen.
ReplyDeleteThanks a lot......
ReplyDeleteThanks ...
ReplyDeleteMove SharePoint Site Collection as a Subsite how do I do his in sharepoint 2013
ReplyDeleteIt does not seem to work with 2013
ReplyDelete@Rendani, I haven't tested this in SP2013, did you try to use similar powershell commands to the stsadm commands?
ReplyDeleteUpdated powershell command for SharePoint 2013
ReplyDeletegetting error that List does not exist. for sharepoint 2013
ReplyDeleteI used the stsadm command to move a site collection to a sub site of another site collection. The migration worked great but afterwards I could no longer create subsites or apps. Is there a fix for this that you know of?
ReplyDelete