0

In SP 2013, on prem, we need to move a sub site from one site collection to another - with all its permissions and versions of documents.

I am thinking of writing this in a SharePoint timer job with c#. All the other logic I can handle, but I am looking for some advice on the part of moving the sites: i.e what should I do, which method should I use etc.

If this can be done by any 3rd party programs, I am also open for some solutions, but first and foremost we want this to be a part of our own solution.

  • Metalogix makes a great tool for this but it's a little pricey. Content Organizer, simple gui copy and paste. – Casey Govero Sep 2 '16 at 3:44
4

You could try using Export-SPWeb and Import-SPWeb w/ PowerShell. These commands have parameters for including security and versions. I think you generally need to create a new subsite at the destination before importing. Here's an example of a bulk archive process I did recently, using a CSV file that contained the URL (.web), Title and Site Collection Relative URL (.subUrl) of all the subsites to be archived:

$items = Import-Csv C:\departmentA_tobearchived.csv
foreach($item in $items){
    $file = "c:\backups\"+$item.title+".cmp"
    $web = Get-SPWeb $item.web
    Export-SPWeb -Identity $web.Url -Path $file -IncludeVersions All -IncludeUserSecurity -NoFileCompression
}

foreach($item in $items){
    $file = "c:\backups\"+$item.title+".cmp"
    $url = "https://root/archive_departmentA"+$item.subUrl
    New-SPWeb -Url $url -Name $item.title
    Import-SPWeb -Identity $url -Path $file -IncludeUserSecurity -NoFileCompression
}

After having the content owners verify the archived content, I just reused the CSV to then delete all the original subsites.

1
  1. Go the the List Settings of the list you want to move
  2. Click Save list as template
  3. Give the list template a descriptive file name, template name, and description
  4. Go to the site's List Template Gallery

    -To do this go the the Site settings -Then List templates

  5. Click your list template to download as a .stp (Sharepoint Template Pack) file

  6. Now, navigate to the site you want to move this list to
  7. Go to the destination site's List Template Gallery
  8. Click Files -> Upload Document, and select the stp file you downloaded
  9. Go to the Site Contents of the destination site, and click add an app
  10. Your uploaded templates will now be listed under Apps you can add

Get in detailed here to migrate SharePoint list items & documents whilst preserving metadata properties: https://sharepointsolutiontips.blogspot.in/2016/09/how-to-migrate-sharepoint-list-while.html

Through powershell you can copy the list and libraries from source site and can deploy to destination site without breaking the connection of lookup column present in lists. You can find solution in the below URL: http://sharepointvspowershell.blogspot.in/2015/08/migrate-sharepoint-list-with-its.html

Copy SharePoint List or Library between Sites with PowerShell at http://sharepointdiary.com/2012/12/copy-list-between-sites-powershell.html

The best bet would be to try a third party SharePoint migration tool as they can take care of all your data, metadata included.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.