How to Make a Copy of a SharePoint List with All Content/Data?

Anonymous
2024-10-25T15:56:31+00:00

I need to create a duplicate of a SharePoint list that includes both the list structure (columns, data types, views) and all the content/data currently stored in it.

Thank you for your help!

Microsoft 365 and Office | SharePoint | Other | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-10-26T00:07:22+00:00

    Dear Farazuddin Mohammed,

    Good day! Thank you for posting to Microsoft Community. We are happy to help you.

    We are sorry to hear that you’re having trouble with to make a Copy of a SharePoint List with All Content/Data. I deeply understand the inconvenience caused and apologize for it.

    You can follow the below steps to duplicate your List into another Site using PowerShell.

    The first thing we’ll do is to register App so that we can use PnP cmdlet on this device

    Register-PnPAzureADApp -ApplicationName TestApp -Tenant m*************8.onmicrosoft.com -Store CurrentUser -Interactive

    Image

    Then connect to the source site.  (Please note that the ClientID is obtained while registering the app like in the Above screenshot)

    Connect-PnPOnline -Url "https://m*************8..sharepoint.com/sites/AlphaTest" -Interactive -ClientId 62*************27e8
    

    We actually have two lists we need to copy. Fellowship Members is the list we care about but, since it contains a lookup column, we need to grab the Middle Earth Locales lookup list as well.

    Get-PnPSiteTemplate -Out ListsAL.xml -ListsToExtract "Alpha List" -Handlers Lists
    

    We’ll use the Add-PnPDataRowToSiteTemplate cmdlet to populate our list instances with actual list item. Add-PnPDataRowsToSiteTemplate -Path ListsAL.xml -List "Alpha List" Now we connect to the target site. Connect-PnPOnline -Url "https://m8.sharepoint.com/sites/Beta" -Interactive -ClientId 6227e8 And we apply our template using the Invoke-PnPSiteTemplate cmdlet.  

    Invoke-PnPSiteTemplate -Path ListsAL.xml

    Image

    We appreciate your understanding that sometimes the initial response may not resolve the problem immediately. However, we can work together to narrow down and resolve the situation. So, please let me know if you have any further questions or if there are any misunderstandings.

    Once again, I apologize for the inconvenience this has caused. We appreciate your patience and understanding and thank you for your time and cooperation.

    Sincerely,

    Ralph Chawatama | Microsoft Community Moderator

    0 comments No comments