Home » SharePoint Online » How to Migrate SharePoint List to Another Site? A Step-By-Step Approach
SharePoint Online ~ 8 Minutes Reading

How to Migrate SharePoint List to Another Site? A Step-By-Step Approach

author
Published By Aldrich Calvin
Anuraag Singh
Approved By Anuraag Singh
Calendar
Published On November 1st, 2023

Overview: SharePoint list is used to store multiple information in the table format. Here you will find how to migrate SharePoint list to another site. There are different ways to move SharePoint list to another site. All the methods are discussed in detail.

The SharePoint list has the crucial data. But due to some of the situations such as mergers, changing tenants, and many more, you need to transfer SharePoint list to another site. The whole process of list transfer to another site is performed by the administrator because Office 365 Admins have different roles and responsibilities.

Table Of Content

Different Methods to Move SharePoint List to Another Site

Basically, there are different methods through which you can move a list from one SharePoint site to another site. The first one is the template method in which you need to download and upload the list template. The second method is performed with the help of PowerShell and the last one is the professional solution. Let’s explore each one in detail.

Method 1. Migrate SharePoint List to Another Site Using the Template method

In this method, you need to create a template of the source SharePoint site for the successful migration. Then you can migrate that template to the destination. Follow the below steps.

Step 1. Save List as Template

  • Open and log in to the SharePoint.
  • Click on the List settings icon.
  • Now go to the Permissions and Management section.
  • Save the list as a template option.

Step 2. Copy of the Template

  • Go to the collection of sites.
  • Click on the Site Settings icon.
  • Now Galleries >> and List template.
  • Tick the checkbox next to the template needed to export.
  • Now hit on the Download copy button.

Step 3. Export Template to Destination Site

  • Go to the destination site with the .stp file.
  • Click on the Site Settings & Galleries.
  • Click on the List template and then the Documents tab.
  • Now hit on the Upload Document option and browse the file.
  • Click OK and the process is completed.

Method 2. How PowerShell Helps to Move SharePoint List to Another Site?

You can also use the PowerShell to move the SharePoint list to another site. But you should be good enough to handle all the complicated PSH commands. Because of some difficult commands, it is not advised to use. But, if you want to move forward with the PSH commands then, you need to create lists on both sites with the same rows and columns. Execute the PowerShell as administrator.

  • If the list is not having any attachments then run,

Install-Module -Name PnP.PowerShell
#Connect to the Source Site
Connect-PnPOnline -Url https://[entertenantname].sharepoint.com/sites/[name of source site] -Interactive
#Create the Template
Get-PnPSiteTemplate -Out C:\Temp\Lists.xml -ListsToExtract “List A”, “List B” -Handlers Lists
Get the List Data
Add-PnPDataRowsToSiteTemplate -Path C:\Temp\Lists.xml -List “List A”
Add-PnPDataRowsToSiteTemplate -Path C:\Temp\Lists.xml -List “List B”
#Connect to Target Site
Connect-PnPOnline -Url https://[entertenantname].sharepoint.com/sites/[name of destination site] -Interactive
#Apply the Template
Invoke-PnPSiteTemplate -Path “C:\Temp\Lists.xml”

  • If the list items contain attachments then,

#Function to copy attachments between list items
Function Copy-SPOAttachments()
{
param
(
[Parameter(Mandatory=$true)] [Microsoft.SharePoint.Client.ListItem] $SourceItem,
[Parameter(Mandatory=$true)] [Microsoft.SharePoint.Client.ListItem] $DestinationItem
)
Try {
#Get All Attachments from Source list items
$Attachments = Get-PnPProperty -ClientObject $SourceItem -Property “AttachmentFiles”
$Attachments | ForEach-Object {
#Download the Attachment to Temp
$File = Get-PnPFile -Connection $SourceConn -Url $_.ServerRelativeUrl -FileName $_.FileName -Path $Env:TEMP -AsFile -force
#Add Attachment to Destination List Item
$FileStream = New-Object IO.FileStream(($Env:TEMP+”\”+$_.FileName),[System.IO.FileMode]::Open)
$AttachmentInfo = New-Object -TypeName Microsoft.SharePoint.Client.AttachmentCreationInformation
$AttachmentInfo.FileName = $_.FileName
$AttachmentInfo.ContentStream = $FileStream
$AttachFile = $DestinationItem.AttachmentFiles.Add($AttachmentInfo)
Invoke-PnPQuery -Connection $DestinationConn
#Delete the Temporary File
Remove-Item -Path $Env:TEMP\$($_.FileName) -Force
}
}
Catch {
write-host -f Red “Error Copying Attachments:” $_.Exception.Message
}
}
#Function to copy list items from one list to another
Function Copy-SPOListItems()
{
param
(
[Parameter(Mandatory=$true)] [Microsoft.SharePoint.Client.List] $SourceList,
[Parameter(Mandatory=$true)] [Microsoft.SharePoint.Client.List] $DestinationList
)
Try {
#Get All Items from the Source List in batches
Write-Progress -Activity “Reading Source…” -Status “Getting Items from Source List. Please wait…”
$SourceListItems = Get-PnPListItem -List $SourceList -PageSize 500 -Connection $SourceConn
$SourceListItemsCount= $SourceListItems.count
Write-host “Total Number of Items Found:”$SourceListItemsCount
#Get fields to Update from the Source List – Skip Read only, hidden fields, content type and attachments
$SourceListFields = Get-PnPField -List $SourceList -Connection $SourceConn | Where { (-Not ($_.ReadOnlyField)) -and (-Not ($_.Hidden)) -and ($_.InternalName -ne “ContentType”) -and ($_.InternalName -ne “Attachments”) }
#Loop through each item in the source and Get column values, add them to Destination
[int]$Counter = 1
ForEach($SourceItem in $SourceListItems)
{
$ItemValue = @{}
#Map each field from source list to Destination list
Foreach($SourceField in $SourceListFields)
{
#Check if the Field value is not Null
If($SourceItem[$SourceField.InternalName] -ne $Null)
{
#Handle Special Fields
$FieldType = $SourceField.TypeAsString
If($FieldType -eq “User” -or $FieldType -eq “UserMulti”) #People Picker Field
{
$PeoplePickerValues = $SourceItem[$SourceField.InternalName] | ForEach-Object { $_.Email}
$ItemValue.add($SourceField.InternalName,$PeoplePickerValues)
}
ElseIf($FieldType -eq “Lookup” -or $FieldType -eq “LookupMulti”) # Lookup Field
{
$LookupIDs = $SourceItem[$SourceField.InternalName] | ForEach-Object { $_.LookupID.ToString()}
$ItemValue.add($SourceField.InternalName,$LookupIDs)
}
ElseIf($FieldType -eq “URL”) #Hyperlink
{
$URL = $SourceItem[$SourceField.InternalName].URL
$Description = $SourceItem[$SourceField.InternalName].Description
$ItemValue.add($SourceField.InternalName,”$URL, $Description”)
}
ElseIf($FieldType -eq “TaxonomyFieldType” -or $FieldType -eq “TaxonomyFieldTypeMulti”) #MMS
{
$TermGUIDs = $SourceItem[$SourceField.InternalName] | ForEach-Object { $_.TermGuid.ToString()}
$ItemValue.add($SourceField.InternalName,$TermGUIDs)
}
Else
{
#Get Source Field Value and add to Hashtable
$ItemValue.add($SourceField.InternalName,$SourceItem[$SourceField.InternalName])
}
}
}
#Copy Created by, Modified by, Created, Modified Metadata values
$ItemValue.add(“Created”, $SourceItem[“Created”]);
$ItemValue.add(“Modified”, $SourceItem[“Modified”]);
$ItemValue.add(“Author”, $SourceItem[“Author”].Email);
$ItemValue.add(“Editor”, $SourceItem[“Editor”].Email);
Write-Progress -Activity “Copying List Items:” -Status “Copying Item ID ‘$($SourceItem.Id)’ from Source List ($($Counter) of $($SourceListItemsCount))” -PercentComplete (($Counter / $SourceListItemsCount) * 100)
#Copy column value from Source to Destination
$NewItem = Add-PnPListItem -List $DestinationList -Values $ItemValue
#Copy Attachments
Copy-SPOAttachments -SourceItem $SourceItem -DestinationItem $NewItem
Write-Host “Copied Item ID from Source to Destination List:$($SourceItem.Id) ($($Counter) of $($SourceListItemsCount))”
$Counter++
}
}
Catch {
Write-host -f Red “Error:” $_.Exception.Message
}
}
#Set Parameters
$SourceSiteURL = “https://[tenantnamehere].sharepoint.com/sites/[sitenamehere]”
$SourceListName = “[listnamehere]”
$DestinationSiteURL = “https://[tenantnamehere].sharepoint.com/sites/[sitenamehere]”
$DestinationListName = “[listnamehere]”
#Connect to Source and destination sites
$SourceConn = Connect-PnPOnline -Url $SourceSiteURL -Interactive -ReturnConnection
$SourceList = Get-PnPList -Identity $SourceListName -Connection $SourceConn
$DestinationConn = Connect-PnPOnline -Url $DestinationSiteURL -Interactive -ReturnConnection
$DestinationList = Get-PnPList -Identity $DestinationListName -Connection $DestinationConn
#Call the Function to Copy List Items between Lists
Copy-SPOListItems -SourceList $SourceList -DestinationList $DestinationList

Drawbacks of PowerShell and Template Method

Both the manual solutions have some drawbacks due to which these methods are not advised to use. Some of the key drawbacks are.

  • Suitable for Small Migrations Only – The template method is only applicable for the small size of sites. If the template size is bigger than 50 MB, then it will not work.
  • Data Loss – By using the PowerShell commands there is a huge risk of data loss. All the commands should be properly executed, if any of the commands is not followed in the order then the data will be affected.
  • Complexities – The manual methods are complicated and need to be executed with the focused. Misjudging or skipping any step does not give the expected results.
  • Lack of Advanced Features – In the manual methods, no advanced feature is there such as filtering out data and others.

Method 3. Professional Solution to Migrate SharePoint List to Another Site

The professional solution is recommended by the experts because it uses the SysTools SharePoint Migration tool to migrate SharePoint Site to another site. Using this tool you can transfer the site data easily without hassle. As the drawbacks of the manual methods, here you do not need to be good at technicalities. This tool is operated by drag-and-drop operations. Using this tool, you can also copy document library from one site to another. It is also having some advanced features that make the migration easier.

 Download Now  Purchase Now

Features of the Professional Solution Which Makes the Process Easier

  • Advance Date filter to filter out the data as per the requirement.
  • Able to migrate the SharePoint site to another site.
  • Also supports the migration of the Document Library with the List.
  • Ensures the security of the data.
  • No limitation on file size.

Step-By-Step Approach to Transfer SharePoint List to Another Site Using Professional Solution

Step 1. Download and Launch the tool on the system and select Office 365 as Source and destination.

hyper v recovery

Step 2. Under the workload section select the sites and apply the Date filter.

select partition

Step 3. Enter the Source credentials then validate and Next.

scanned vhd file

Step 4. Complete the Destination details validate them and Next.

scan partition

Step 5. Load the users and Next.

no

Step 6. In the sites tab, fetch the sites and click on Validate.

Step 7. Click on the Start Migration button to start the process.

migration options

Conclusion

In this write-up, we have discussed all the methods to migrate SharePoint list to another site. If you are good at technicalities and confident enough to execute the manual methods then you can go with the manual methods with the SharePoint Online migration checklist. Otherwise, the professional solution is the best one for the list migration from One SharePoint site to another.