Home » Blog » Migration » Migrate SharePoint List to Another Site in Top 3 Ways

Migrate SharePoint List to Another Site in Top 3 Ways

author
Published By Nilesh Kumar
Debasish Pramanik
Approved By Debasish Pramanik
Published On May 26th, 2023
Reading Time 9 Minutes Reading
Category Migration

SharePoint Online is Microsoft’s offering for the collaboration of teams from different departments in an organization. SharePoint Lists have columns & rows with information like contacts, link lists, calendars, tasks, etc. Users often want to migrate SharePoint List to another Site due to several reasons. This is all we are going to talk about in this blog for users’ ease.

Before we proceed, let’s have a look at the user queries first:

Hi everyone, Im Albert Smith from the United States. It’s been a long that I’m trying to migrate SharePoint Online List to another Site of SharePoint. However, even after trying a couple of solutions, I’m still not able to get the results I desire. Is there any way by which I can migrate the Document Library & List to another Site? Please suggest the best & easy way possible. Also, Can I merge two SharePoint sites together?

Table of Content

Migrate SharePoint Online List to Another Site Via Template Method

The first method for users is to create a template of their SharePoint Site & then migrate it t another Site. It includes three major steps mentioned below:

Step-1. Save List as Template

This step involves the process of saving the desired Lists as a template.

  • Login to SharePoint Online platform.
  • Navigate to the List Settings option.
  • Click on Permissions & Management section.
  • Hit the Save List as Template option to finish.

Step-2. Get A Copy of the Template

In this step, users need to make a copy of the template that they just created in the above step.

  • Go to the Top-Level Site of the Site collection where your sites are stored.
  • Now, Simply Navigate to the Site Settings option.
  • Go to the Galleries section >> Click on Lists templates.
  • Enable Checkbox next to the template needed to export.
  • Hit the Download a Copy button in the ribbon.

Step-3. Export Template to Another Site Collection

Now, this is the final step & all we need to do is just export the template we saved to the desired destination. This way they can complete the process to migrate SharePoint List to another Site easily.

  • Along with your .stp file, navigate to the desired site collection.
  • Click on the Site Settings option & Go to Galleries now.
  • Click on List Templates & then on the Documents tab.
  • Click on Upload Document option & browse the file.
  • Click the Ok button to end the task.

PowerShell Method to Migrate SharePoint Lists

Another method that we have is the PowerShell Command method. If the user is proficient in the PSH commands, they can easily get the best solution without any difficulties at all. The method is free but the challenges & risks it brings, make users difficult to select this.

However, if you are still interested in this method, simply follow the below SharePoint migration checklist & then execute the PowerShell cmd as it is.

  • Create separate lists on both sites. These lists must have the same rows & columns.
  • Run the PowerShell as an Administrator to not get stuck for permissions approval.

Change the variables mentioned to migrate SharePoint List to another Site as easily as it can be.

Run the below command in case there are no attachments present in the list items.

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”

In case your list items have attachments, run the below command carefully.

#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

Having no issues with the settings & configuration, users can experience that the migration is complete & successful without any issues.

Drawbacks of the PowerShell & Template Methods

The manual solution for users includes several drawbacks as well. It looks easy from the front but when we dive deeper, we get to know the hidden secrets & other limitations. Let’s look at some of the most common limitations of manual methods to migrate SharePoint Online List to another Site.

Suitable for Only Small Migrations

The template method only works for sites of small sizes. In case the template size is bigger than 50MB, users can’t opt for this solution.

High Risk of Data Loss

Now, users interested in PowerShell method must know that the success ratio here is very low. Users often lose their data files or end up with corruption in them due to many errors.

Full of Complexities

The manual methods are not as simple as they look. The process is complex & are need to be followed in a strict chronological order. Violating which, users can’t the desired results.

No Advance Features

Not any of the manual methods include any advanced features. Keeping aside the factor that these solutions are old, they still should have some modern features to execute the task in the minimum steps possible.

Automated Solution to Migrate SharePoint List to Another Site

Step-1. Launch the SharePoint Online Migration Tool in the system to begin. 

select office 365

Step-2. Now, just Select the Sites & Generic Lists checkbox under it.

select sites

Step-3. Enter the Credentials of Source & Destination & Validate them.

enter credentials

Step-4. Map your Source Sites to the Destination Sites to proceed.

map sites

Step-5. Click Start Migration to migrate SharePoint Online List to another Site.

click start migration

Now, as we are aware of the drawbacks of manual solutions, Opting for the above-mentioned automated solution is the right choice for users. Download the tool for free & run the demo to explore the exciting features & experience.

Download Now Purchase Now

Top Features of the Automated Solution for SharePoint Lists Migration

The automated solution is packed with some top advanced features that allow users to migrate SharePoint Online List to another Site without any hassles at all. Let’s explore these benefits to get help making a wise decision for selecting the method.

  • Advance date filters help easily migrate list data from a specific time period to another site.
  • Users can also move SharePoint Site to another Site using this automated solution.
  • The software offers users to migrate not only lists but also the document library having all its data items.
  • The automated software is reliable & keeps the user data secured without any risks.
  • The software is capable of migrating data of any file size seamlessly.
  • SharePoint Online tenant to tenant migration is also possible using the above-mentioned method.
  • Several other features like batch migration, track migration, status report, etc are there to help users get the most simplified experience.

Conclusion

Now we know migrate SharePoint List to another Site using all three methods that are available nowadays. If users are confident & well proficient in SharePoint technicalities, then only they can execute the manual method. Otherwise, the automated solution is the all-time best solution to get the desired results.

  author

By Nilesh Kumar

As a Chief Technical Writer, I know the technical issues faced by home and professional users. So, I decided to share all my knowledge via this blog. I love to help you with challenges while dealing with technical jargon.