Forum Discussion
RJF61
Jan 18, 2023Copper Contributor
Copy SharePoint List and Data
I have a SharePoint List where I am making some updates to columns, etc. Is there a way to copy ALL data from one list to another? I have duplicated the list structure but now need to copy informat...
SvenSieverding
Jan 19, 2023Bronze Contributor
Hi RJF61
you can use PnP Powershell for that
Connect-PnPOnline https://tenant.sharepoint.com/sites/SourceSite -Interactive
Get-PnPSiteTemplate listtemplate.pnp -Handlers Lists -ListsToExtract "<List Name>"
Add-PnPDataRowsToSiteTemplate .\listtemplate.pnp -List "<List Name>"
Connect-PnPOnline https://tenant.sharepoint.com/sites/TargetSite -Interactive
Invoke-PnPSiteTemplate .\listtemplate.pnp
But that does not copy the created and modified information... these columns will have the value of you and now.
If we create a more complicated powershell script that copies the values of every source item into a csv file and then insert these items into the new list, we can overwrite the modified and created information. But that script will need to be more tailored to a specific list.
Or you need to use a third party tool like ShareGate.
Best Regards,
Sven