News We Recently Launched AD Migrator and AD Reporter.

Copy Document Library to Another SharePoint Site – Expert’s Suggested Ways

  author
Written By Mohit Jha
Anuraag Singh
Approved By Anuraag Singh
Published On October 10th, 2024
Reading Time 12 Minutes Reading

Overview: This guide is specially curated for users who are actively looking for a reliable way to copy document library to another SharePoint site. In this write-up, we have described the different ways that users can follow to execute this task with flying colors. 

If you are working with one of the most popular business productivity suites i.e.  Microsoft 365, and in particular SharePoint sites, then there must be a time when you needed to move document library from one site to another in SharePoint online . Although there are numerous ways to do this. But having the best ones makes your task simpler and more efficient. So, without any further ado, let’s get into it!

What Could Be the Reasons Behind Moving Document Library from One Site to Another?

The reasons could be anything such as: 

  • SharePoint Site Restructuring, 
  • Undergoing data migration in SharePoint, 
  • Consolidation of two SharePoint Sites,
  • Access control changes in SharePoint Library,
  • For creating a new test Environment,
  • For SharePoint backup and recovery.

There might be several reasons for this but the elephant in the room is how to copy Document Library from one Site to another easily.  

7 Methods to Move Document Library from One Site to Another in SharePoint Online

There are no direct methods offered by Microsoft. However, you can use some of the indirect manual workarounds to perform this task and you can also utilize reliable software to perform this task efficiently:

Let’s discuss each of them step by step in the coming section.

Method 1. Copy Document Library to Another SharePoint Site Using the Most Reliable Software

Since there are no direct methods to complete this task, hence, it is suggested to switch to a professional software solution such as SysTools SharePoint Online Migration Tool. It ensures maximum data security and integrity throughout the entire migration process.

It comprises several smart features such as:

  • Effortless migration between SharePoint Sites with metadata.
  • Transfer Document Library from one SharePoint Site to another.
  • Batch migration supported for efficiently moving multiple SharePoint Sites.
  • Smooth migration of document sets and document Folders.
  • Smart Date-based filtering for targeted migration of SharePoint Site contents.
  • Ability to match permission settings from source users to destination users.
  • Built-in dashboard for Real-time tracking of migration progress.
  • Delta migration feature to transfer only new data from SharePoint Sites.
  • Option to pause ongoing migration as needed.
  • Detailed and Summary Reports provided for migration.
  • Compatibility with Windows 11, 10 (64-bit), Windows Server 2012, 2016.

Software Steps to Move Document Library from One Site to Another in SharePoint Online

Step 1. Click on the below Download button to download and install the software on your computer. 

Download Now Purchase Now

Step 2. Choose Office 365 as the source and destination platform. And move to the workload selection screen.

copy document library to another SharePoint site

Step 3. Now check the Sites option, it will enable Document Library and Generic List. Now apply the date filter if you want to move document library from one site to another selectively and click on Next.

move Document Library

Step 4. Move to the next tab which is the Source tab, here you have to log in with the source Office 365 admin account credentials. Click on the validate button to validate the provided details. Click on the Next button.  

Document Library from One Site to Another steps

Step 5. Moving to the Destination tab, like the last step you have to log in to the software using the destination Office 365 admin account credentials. Click on the validate button to validate the provided details. Click on the Next button. 

migrate Document Library from One Site

Step 6. Now navigate to the Resources tab, here you you can see we have different options to add users to the software. You can use any methods provided such as Fetch Users, Import Users, or Download templates.

copy document library to another SharePoint site

Step 7. Similar to the user you can add all the sites by using any of the methods provided such as Fetch Sites, Import Sites, or Download templates

copy document library to another SharePoint site

Step 8. Select the source and destination site URL and click on the validate button to validate the required permissions regarding sites. Lastly, click on the Start button to initiate the process.

move Document Library from One Site to Another using Indigenous Ways

Method 2. Copy Document Library to Another SharePoint Site using PowerShell

With the below PowerShell scripts, you can automate copying files and their associated metadata from one SharePoint document library to another. 

Find out the below PowerShell scripts for this task, A few points to remember –

We have updated the SharePoint CSOM assemblies path to version 20. Additionally removed the “Forms” folder check condition in the subfolder processing loop. Apart from this we have also adjusted the credential input prompt and made the required formatting improvements for better readability.

# Import SharePoint CSOM Assemblies

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\20\ISAPI\Microsoft.SharePoint.Client.dll"

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\20\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

Function Copy-AllFilesWithMetadata  

{  

    param  

    (  

        [Parameter(Mandatory=$true)] [Microsoft.SharePoint.Client.Folder] $SourceFolder,  

        [Parameter(Mandatory=$true)] [Microsoft.SharePoint.Client.Folder] $TargetFolder  

    )  

    Try {  

        # Get all Files from the source folder  

        $SourceFilesColl = $SourceFolder.Files  

        $SourceFolder.Context.Load($SourceFilesColl)  

        $SourceFolder.Context.ExecuteQuery()  

 

        # Iterate through each file and copy  

        Foreach($SourceFile in $SourceFilesColl)  

        {  

            # Get the source file  

            $FileInfo = [Microsoft.SharePoint.Client.File]::OpenBinaryDirect($SourceFolder.Context, $SourceFile.ServerRelativeUrl)  

               

            # Copy File to the Target location  

            $TargetFileURL = $TargetFolder.ServerRelativeUrl+"/"+$SourceFile.Name  

            [Microsoft.SharePoint.Client.File]::SaveBinaryDirect($TargetFolder.Context, $TargetFileURL, $FileInfo.Stream,$True)  

 

            # Copy Metadata field values  

            $SourceListItem = $SourceFile.ListItemAllFields  

            $SourceFolder.Context.Load($SourceListItem)  

            $SourceFolder.Context.ExecuteQuery()  

 

            # Get the new file created  

            $TargetFile = $TargetFolder.Context.Web.GetFileByServerRelativeUrl($TargetFileURL)  

            $TargetListItem = $TargetFile.ListItemAllFields  

 

            # Set Metadata values from the source  

            $Author =$TargetFolder.Context.web.EnsureUser($SourceListItem["Author"].Email)  

            $TargetListItem["Author"] = $Author  

            $Editor =$TargetFolder.Context.web.EnsureUser($SourceListItem["Editor"].Email)  

            $TargetListItem["Editor"] = $Editor  

            $TargetListItem["Created"] = $SourceListItem["Created"]  

            $TargetListItem["Modified"] = $SourceListItem["Modified"]  

            $TargetListItem.Update()  

            $TargetFolder.Context.ExecuteQuery()  

 

            Write-host -f Green "Copied File '$($SourceFile.ServerRelativeUrl)' to '$TargetFileURL'"  

        }  

 

        # Process Sub Folders  

        $SubFolders = $SourceFolder.Folders  

        $SourceFolder.Context.Load($SubFolders)  

        $SourceFolder.Context.ExecuteQuery()  

        Foreach($SubFolder in $SubFolders)  

        {  

            If($SubFolder.Name -ne "Forms")  

            {  

                # Prepare Target Folder  

                $TargetFolderURL = $SubFolder.ServerRelativeUrl -replace $SourceLibrary.RootFolder.ServerRelativeUrl, $TargetLibrary.RootFolder.ServerRelativeUrl  

                Try {  

                    $Folder=$TargetFolder.Context.web.GetFolderByServerRelativeUrl($TargetFolderURL)  

                    $TargetFolder.Context.load($Folder)  

                    $TargetFolder.Context.ExecuteQuery()  

                }  

                catch {  

                    # Create Folder  

                    if(!$Folder.Exists)  

                    {  

                        $TargetFolderURL  

                        $Folder=$TargetFolder.Context.web.Folders.Add($TargetFolderURL)  

                        $TargetFolder.Context.Load($Folder)  

                        $TargetFolder.Context.ExecuteQuery()  

                        Write-host "Folder Added:"$SubFolder.Name -f Yellow  

                    }  

                }  

                # Call the function recursively  

                Copy-AllFilesWithMetadata -SourceFolder $SubFolder -TargetFolder $Folder  

            }  

        }  

    }  

    Catch {  

        write-host -f Red "Error Copying File!" $_.Exception.Message  

    }  

}  

 

# Set Parameter values  

$SourceSiteURL="https://crescent.sharepoint.com/sites/sales"  

$TargetSiteURL="https://crescent.sharepoint.com/sites/Ops"  

$SourceLibraryName="Shared Documents"  

$TargetLibraryName="Documents"  

# Setup Credentials to connect  

$Cred= Get-Credential  

$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)  

# Setup the contexts  

$SourceCtx = New-Object Microsoft.SharePoint.Client.ClientContext($SourceSiteURL)  

$SourceCtx.Credentials = $Credentials  

$TargetCtx = New-Object Microsoft.SharePoint.Client.ClientContext($TargetSiteURL)  

$TargetCtx.Credentials = $Credentials  

# Get the source library and Target Libraries  

$SourceLibrary = $SourceCtx.Web.Lists.GetByTitle($SourceLibraryName)  

$SourceCtx.Load($SourceLibrary)  

$SourceCtx.Load($SourceLibrary.RootFolder)  

$TargetLibrary = $TargetCtx.Web.Lists.GetByTitle($TargetLibraryName)  

$TargetCtx.Load($TargetLibrary)  

$TargetCtx.Load($TargetLibrary.RootFolder)  

$TargetCtx.ExecuteQuery()  

# Call the function  

Copy-AllFilesWithMetadata -SourceFolder $SourceLibrary.RootFolder -TargetFolder $TargetLibrary.RootFolder

Limitations of Using PowerShell Scripts

  • Limited and basic error handling with Try-Catch blocks.
  • Assumes specific folder structure which is limited flexibility for deviations.
  • Copies predefined metadata fields that lack support for custom fields.
  • Chances of performance issues with large SharePoint libraries.
  • Dependency on SharePoint CSOM assemblies for execution.
  • Interactive credential input which is not suitable for unattended tasks.
  • Complex customization requirements for specific environments.
  • Absence of progress tracking or logging during or post-execution.
  • Single-threaded operation which may be inefficient for large datasets.
  • Compatibility constraints with different SharePoint versions and deployments.

Method 3. Move SharePoint Document Library Using “Save As” Feature of SharePoint

Follow the below steps but remove empty folders in SharePoint Online for reducing data redundancy.

  • Step 1. Access the source document library.
  • Step 2. Choose the files or folders for copying.
  • Step 3. Employ the “Download” or “Save As” feature to store these files/folders locally.
  • Step 4. After the completion of downloading files (.zip). Go to the destination SharePoint site and library.
  • Step 5. Perform an upload of the saved files/folders.

Method 4. Transfer Document Library in SharePoint Online Modern Experience

  • Step 1. Login to the Source Site account and navigate from where you want to move the Document Library data to the destination site.
  • Step 2. Now open that library >> Hit the Gear icon provided in the top-right corner.
  • Step 3. From the dropdown menu select the Site Contents option.
  • Step 4. Hit the 3 dots beside the Document Library that you want to copy or move to the destination SharePoint site.
  • Step 5. A Copy to dialog box will appear; enter the Site URL where you want to copy the document.
  • Step 6. Lastly, you have to select the Document Library in the destination site and hit the “Copy” button.

Method 5. How to Copy Document Library to Another SharePoint Site Using Admin Center?

Copying the document library from one SharePoint site to another means just replicating the document library. So, let’s start the process of moving the SharePoint document library to another site.

1. Open the Destination SharePoint site and then hit the New button from the Site homepage.

2. Choose the option of Document Library.

3. Select the “From Existing Library” option from the opened window.

copy document library to another sharepoint site

4. Now, open the SharePoint site from where the document library is to be copied. Choose Document Library and then hit Next.

5. Choose a Document Library to use as a template for the new document library.

6. Provide the name and description for the new Document Library and hit Create.

Limitations

  • In this method, only the columns and views are replicated in the new document library( it will not copy the files and folders).
  • You might also face the “This list has a dependency on another list with a template type that is not supported” error. It is because of the Audience Targeting option.

Method 6. Move Document Library from One Site to Another SharePoint Online Using Save as Template Option?

You can also perform the task manually. But this method requires some technical experience along with patience. 

Step 1. Save the Source Document Library

  • Open the SharePoint document library that you want to copy.
  • Go to its Settings then choose Save Document Library as Template.
  • Provide the file and template name.
  • Include the content and press OK.
  • After that, open the Site settings and Download the template.

Step 2. Move the Downloaded Template to the Destination SharePoint Site

  • Open the targeted SharePoint site > Settings.
  • Upload the template and then assign the name and Description.
  • Now, open the Site Contents and App.
  • Choose the template that you uploaded.
  • Complete the details and create the document library.

Step 3. Setup the New Document Library Settings

  • After the successful moving of the document library to another site, open its Settings.
  • Configure the permissions, metadata, and other essentials.
  • If the document library does not contain the files and folders then copy them manually.

Method 7. Use OneDrive Sync for Replicating Document Library

Microsoft 365 comprises OneDrive in its plan and it stores the data of Teams and SharePoint. So, you can also use OneDrive to copy document library to another SharePoint site.

  1. Set up syncing with OneDrive.
  2. After that, open the OneDrive synced files.
  3. Copy the files and folders that you want to copy.
  4. Now, paste them to the Destination SharePoint site document library folder.
  5. Wait for sync and Done.
Why You Should Choose Automated Software Over the Manual Methods?
  • The manual methods are time-consuming and error-prone.
  • It can not be efficient for handling large-scale tasks and it lacks scalability.
  • You can face several challenges in maintaining consistency throughout the migration.
  • It might end up with higher operational costs than the automated one.
  • It lacks migration monitoring and tracking capabilities.
  • With manual methods, you have an Increased risk of data loss and dependency on individual skills.
  • It also increases security concerns with the potential for human errors leading to data exposure.
Bringing It All Together

While working with Microsoft sites there can be several scenarios where a user need to copy Document Library to another SharePoint site. But, there is no direct way offered by Microsoft for this task. Hence, we have illustrated different ways in this guide to accomplish this task efficiently. You can use one as per your choice and requirements. 

Frequently Asked Questions

Q1. How to get rid of the “This list has a dependency on another list with a template type that is not supported” error?

A – It is because you have enabled the audience targeting option. To correct it, open the Audience targeting settings and uncheck it.

Q2. Is metadata also moved while moving one SharePoint document library to another site?

A – Yes, metadata is also shifted with the document library. But all the metadata details are not moved successfully, they require manual configurations. But if you opt for the above-mentioned professional software then it will copy all metadata details easily.

Q3. What are the best practices for an error-free moving of a document library to another site?

A – For an efficient replication of the document library, you should try with the test document library containing test files and folders. You need to do this, if you are using the manual approaches. On the other hand, if you go with the professional tool then you do not need to worry. It will take care of all the permissions and data.

Q4. What are the quick steps to copy document library to another SharePoint site?

A – Accomplish your task with the professional tool with the below steps:-

  1. Download and Set up the tool.
  2. Choose Source & Destination platforms.
  3. Enable Sites and filter them.
  4. Provide details of both platforms.
  5. Add Users and Start Migration.
  author

By Mohit Jha

Mohit is a writer, researcher, and editor. Cyber ​​security and digital forensics are the two subjects that keep Mohit out of his seat. In addition, he hopes that the well-researched and thought-out articles he finds will help people learn.