In this test case I needed to copy (not move) a SharePoint 2010 site with its content from one site collection to another within the same sp2010 farm.
Creating Site Template
save a SharePoint site as a template – a template will allow you to package a site in to WSP and even include the content however you need to take into consideration the following limitations:
- 50 MB site template limit.
- the template will not include the following :
- Customized permissions
- Running workflow instances
- List item version history
- Workflow tasks associated with running workflows
- People/group field values
- Taxonomy field values
- Publishing pages and publishing sites
- My Sites
Backup and Restore the whole site collection
Using PowerShell create your source site backup:
Backup-SPSite -Identity "http://YourSourceSite" -Path "C:\backups\SourceSite_source.bak" -Force -Confirm:$False
Manually create a new site collection within the farm.
Restore-SPSite "http://myspsite:81" -Path C:\backups\myspsite-81.bak -Force -Confirm:$False
Export Import sub-site
export-spweb -identity http://SourceDomain/SourceSubSite -path \SourceSite_backup.cmp
import-spweb -identity http://TargetDomain/subsite -path \SourceSite_backup.cmp
Both the source and destination Site templates should use the same site template, for example both need to be “team sites”. Note that the CMP format is actually a CAB file which contains xml and DAT files.
Using Content Structure
Within the same site collection you can use the site setting Content and structure option to copy sites from one location to another, for example is you need to move a sub-site this is deep inside the hierarchy and promote it to higher level. Please note that workflow instances will not be copied since they are rooted within the site collection.