Hello everyone,
I'm copying a list from one site to another, in SharePoint Online, I'm following these steps by Salaudeen Rajack from this post:
#Parameters
$SourceSiteURL = "https://crescent.sharepoint.com/sites/Retail"
$TargetSiteURL = "https://crescent.sharepoint.com/sites/Sales"
$ListName= "Projects"
$TemplateFile ="$env:TEMP\Template.xml"
#Connect to the Source Site
Connect-PnPOnline -Url $SourceSiteURL -Interactive
#Create the Template
Get-PnPSiteTemplate -Out $TemplateFile -ListsToExtract $ListName -Handlers Lists
#Get Data from source List
Add-PnPDataRowsToSiteTemplate -Path $TemplateFile -List $ListName
#Connect to destination Site
Connect-PnPOnline -Url $TargetSiteURL -Interactive
#Import the exported list - Apply the Template
Invoke-PnPSiteTemplate -Path $TemplateFile
When I run the step Add-PnPDataRowsToSiteTemplate -Path $TemplateFile -List $ListName, I get the error "The attempted operation is prohibited because it exceeds the list view threshold." I know this error is because of the threshold limitation of 5000 items, my list has over 10 thousand items.
Do you guys have any advise in how I could copy this list to my other site?
I can not use a cloud flow because I need all the metadata (created by, modified by, item ID, etc) from the original list.
Thank you so much in advance for your help!
Best Regards. :)