Data Migration

Imagine the following scenario, in your company there is a SharePoint 2013 web application with huge document library and unique permission levels. The organization revamped this web application to SharePoint 2019 and now they need to migrate the documents along with the security.

Steps to follow for such scenario will be:

  1. Export the document library with the security by using the following CMDLET
    • Export-SPWeb -Identity <Source Site URL> -Path “C:\BKP\docbak.cmp” [-ItemUrl <Library URL>] [-IncludeUserSecurity] [-IncludeVersions] [-NoFileCompression]
  2. Import the exported library by using the following CMDLET
    • Import-SPWeb -Identity <Distination URL> -Path “C:\BKP\docbak.cmp” -Force -NoFileCompression -IncludeUserSecurity

Notice file compression is not used because if the document library is huge, the command could take days to run.

Sometimes the import command will fail. If SharePoint give reasons for failure and mostly it will be related to the security issues, you fix them and try again. If the failure continue to happen you can try the old cmd tool for SharePoint stsadm.exe

stsadm –o gl-importlist -url <Distination URL> -filename “C:\BKP\docbak.cmp” -includeusersecurity -nofilecompression

References:

  1. https://docs.microsoft.com/en-us/sharepoint/administration/export-a-site-list-or-document-library
  2. http://blog.falchionconsulting.com/index.php/2007/09/importexportcopy-lists/