How to Copy a SharePoint List using PowerShell?

Requirement: Copy a SharePoint List to Another List

How to copy a list in SharePoint?

While Export-Import is an option, You can save the list with or without content as a template and create any number of new list or libraries from the list template. Go to the list settings and save the list as a template and then create a new list, pick the list template!

sharepoint copy list

PowerShell to Clone a List in SharePoint

Here is the PowerShell to copy SharePoint list structure using “Save List as Template” and “Create List from Template” methods.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$NewListName = "Projects Archive"
$SaveData= $False

Try {
    #Get the web and List
    $Web = Get-SPWeb $SiteURL
    $List = $Web.Lists[$ListName]

    #Check if the new list doesn't exists
    If($Web.Lists.TryGetList($NewListName) -eq $null)
        #Save list as template
        $List.SaveAsTemplate($List.ID.ToString(), $List.ID.ToString(), [string]::Empty, $SaveData)

        #Get the List template
        $ListTemplate = $web.Site.GetCustomListTemplates($web)[$List.ID.ToString()]

        #Clone list
        $NewList = $web.Lists.Add($NewListName, "$($NewListName)-$($List.Description)", $ListTemplate)

        #Remove the List template file Created
        $ListTemplateFile = $web.Site.RootWeb.GetFolder("_catalogs/lt").Files | where {$_.Name -eq $ListTemplate.InternalName}

        write-host -f Green "List '$ListName' Cloned to '$NewListName!'"
        write-host -f Yellow "List '$NewListName' already exists!"

Catch {
    write-host -f Red "Error Adding Template to Document Library!" $_.Exception.Message

You can use this script to duplicate SharePoint list with content or just list structure. You can set the $SaveData flag to $True to include contents of the list.

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply