Home » Blog » SharePoint » SharePoint Online Migrate List to Another Site All Solutions Explained

SharePoint Online Migrate List to Another Site All Solutions Explained

author
Published By Deepa Pandey
Ashwani Tiwari
Approved By Ashwani Tiwari
Published On March 28th, 2024
Reading Time 10 Minutes Reading
Category SharePoint

sharepoint online migrate list to another site

Microsoft SharePoint is indeed a very useful collaboration tool for the internal communication of an organization. However, there are still some loopholes lefts that trouble the users. Evidently, nowadays it’s difficult for users to execute SharePoint Online migrate List to another Site task due to several complexities.

Therefore, in this informative article, we are going to explain all four possible solutions including the PowerShell method that several users are not even aware of. Therefore let’s begin with our solution.

Tip: If you want to get a hassle-free solution, then forget about the manual solutions. Simply download the best-in-class Sharepoint Online Migration Tool as experts suggest that an automated solution is better than a manual in terms of data security, accuracy, efficiency as well as effectiveness.

Download Now Purchase Now

Template Method for SharePoint Online Migrate List to Another Site

Here comes the first method that we can consider the most appropriate method but only in the category of manual solution. This method is basically involving the simple concept of saving the list as a template & then exporting it to another site.

Before you begin the process, make sure you are aware of the SharePoint Online migration best practices in depth. Follow the below steps carefully to get the desired results:

Step-1. Save Template

  • Login to your SharePoint account & Navigate to List Settings pane.
  • Now from here, Go to the Permissions & Management section.
  • Click on the Save List as Template option here.

Step-2. Export the List

  • Click on the Site Settings at the top level site of the site collection.
  • Navigate to the Galleries & Click on the List Template option.
  • Go to List Template Gallery & Select your desired List here.
  • Now Click on the Download a Copy option to proceed.

Step-3. Uploading List

With the .stp file you’re having, simply go to the Site Collection where you want to transfer the list ultimately.

  • Click Site Settings >> Galleries >> List Templates
  • Click Documents Tab >> Now Upload Documents
  • Go to Choose File >> Browse and Select .stp File
  • Finally, Click on the OK Button to Finish the Task.

Learn the New List Method for Small Sites

A few weeks ago, one user emailed me his problem & asked for a solution regarding the same problem. However, his request was a bit different because of this statement in his email:

 “Can you move a SharePoint List from one Site to another without complex methods if the list is small in size?

Well, the answer is YES.

There is an easy solution for users to get the desired results that they can perform in the case of small-size lists. However, this trick won’t work in case the list is way too big. Follow the easy steps mentioned below:

  • Login to SharePoint Online & Go to the Site where you want to migrate the List.
  • Click on the New Button to Select the List Tab.
  • Choose the From Existing List option in the prompt screen.
  • Select the List you want to save on this Site & Click on the Next button.

That’s it, your files are migrated successfully. Now, let’s move on to the automated solution.

SharePoint Online Migrate List to Another Site in 5 Steps

  • Launch the Software & Select Office 365 platform.
  • Select the Lists in the Workload Selection Section.
  • Enter Source & Destination Credentials here.
  • Map Source and Destination Lists to continue.
  • Click on the Start Migration button to complete.

Note: In case you are migrating Lists in the same tenant, simply add the same credentials in the source & destination platforms.

Download the Advanced Software to get the perfect results:

Download Now Purchase Now

PowerShell Method for Sharepoint Lists Migration Across Sites

Now if users are very well proficient in SharePoint technicalities as well as PowerShell Scripts, then they can opt for the PSH method as well. However, this method contains several complexities for SharePoint Online migrate List to another Site in the process.

Prerequisites:

  • Create a separate list first in the destination site, and make sure that both Lists have the same columns.
  • Make sure that you run PowerShell as an administrator to avoid any permission barriers.

Modify the configuration variables mentioned in the below script & run it in PowerShell.

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”

Here, the above command is useful where the Lists do not have any attachments. In case your Lists have attachments, then run the following command:

#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

Manual Vs Modern Solutions – Which One Is Better?

As we solved the user query “can you move a SharePoint List from one Site to another”, it’s time to understand which of the solution is worth trying. So, let’s discuss a few words for both solutions. Here, the manual solution includes the Template method, Export method, & PowerShell method whereas the automated solution includes the software method.

This way users can decide to select the most appropriate solution for SharePoint Online migrate List to another Site task.

Manual Methods

  • Manual solutions are an easy way only in case users are having small-size lists.
  • The PowerShell method is quite risky as it involves complex commands.
  • These solutions are free to use if you have a SharePoint subscription.
  • There is no surety of data security in case anything goes wrong.
  • It performs the task but significantly lacks several features.
  • These methods do not perform cross-tenant migration. 

Automated Methods

  • This solution is suitable for both big & small size operations.
  • An automated solution is so far the safest solution available.
  • It comes with plenty of features that make the task easier.
  • Selective migration is possible where with the Date Filter.
  • The solution isn’t free but comes at a very decent price.
  • Cross-tenant migration is also possible for users here.

Also Read: Learn the Best Way to Migrate Microsoft Teams to A New Tenant Safely

In A Nutshell

Finally, after discussing all four solutions, we have come to the conclusion that the most reliable solution is an automated one. Although all four solutions work well but have their own limitations.

From an organization’s point of view, users can’t afford to bare these limitations as data is the most valuable asset in this century. Rest, as per your requirements, select any of the four methods you like for your SharePoint Online migrate List to another Site operation.

FAQs

Q-1. Can you move a SharePoint List from one Site to another one?

Ans: Yes, this task is possible & there are both manual as well as automated solutions available for this.

Q-2. How do I move a SharePoint Online list to another site?

Ans: There are four solutions available for users that are:

  • Modern Approach
  • Template Method
  • Export Method
  • PowerShell

Q-3. How do I sync a SharePoint Online List?

Ans: Six steps to sync a SharePoint Online Lists:

  • Go to Project > Choose File > Click Save button.
  • Select the Sync with SharePoint option to proceed.
  • Select the New SharePoint Site in Sync with List.
  • Provide a Name in the Project Name Box option.
  • Add the Address of the SharePoint task List.
  • Hit the Save button.