This is an example for copying SharePoint list items while bringing over all their metadata, including version history, attachments, permissions, authors and timestamps between one SharePoint lists to another. You can apply this pattern to copy documents between one SharePoint library to another.
- After you've launched Sharegate, the first thing you'll see is the Home Screen. To launch PowerShell, click Powershell.
- Type Import-Module Sharegate.
- Connect to your source SharePoint site, this is the site that contains the list you want to copy content from (see Connect-Site).
$srcSite = Connect-Site -Url http://myfarm1/sites/mysourcesite
- Get your source list that you want to copy content from (see Get-List).
$srcList = Get-List -Site $srcSite -name Documents
- Connect to your destination SharePoint site, this is the site that contains the list you want to copy content to (see Connect-Site).
$dstSite = Connect-Site -Url http://myfarm2/sites/mydestinationsite
- Get your destination list that you want to copy content to (see Get-List).
$dstList = Get-List -Site $dstSite -name Documents
- Copy the content from source list to the destination list (see Copy-Content)
$result = Copy-Content -SourceList $srcList -DestinationList $dstList
- You can print the result in the windows or export the migration report to an Excel file (see Export-Report).
$result Result : Operation completed successfully. SessionId : 140220-9 SiteObjectsCopied : 0 ItemsCopied : 123 Warnings : 0 Errors : 0 PS C:\> Export-Report -CopyResult $result -Path C:\Reports\MyCopyListContentReports.xlsx