SharePoint Document Issues

How to Copy SharePoint Files to Another Library with Metadata

Aamir Naveed AkramAamir Naveed Akram Nov 3, 2026 870 views

Question details

The user needs to copy files from one SharePoint library to another without losing custom and managed metadata values.

How to Copy SharePoint Files to Another Library with Metadata
Product
SharePoint Online
Device & OS
not provided
Scenario
Migrating or duplicating documents across different SharePoint libraries where maintaining specific metadata properties is critical for organization.
Observed behavior
Standard file copying processes preserve the files themselves but often drop or fail to copy custom metadata and managed metadata values.
Before you start

Ensure you have SharePoint Administrator or Global Administrator permissions to run PowerShell commands, and verify that the destination library has the exact same metadata columns configured as the source library.

Solution 1Recommended

Enable Custom Scripting and Use Automation

Use the SharePoint Online Management Shell to enable custom scripting, then utilize custom code or Power Automate to reapply lost metadata after the copy.

Standard SharePoint copy operations often fail to retain managed metadata, even when the destination library has matching columns.

Enabling custom scripts allows for broader library templating features. However, because native copying still struggles with metadata retention, you must implement a secondary process using Power Automate or custom code to update the destination files after they are copied.

1
Open SharePoint Online Management Shell

Install and open the SharePoint Online Management Shell as an administrator on your computer.

2
Connect to SharePoint Admin Center

Connect to your tenant by running the command: Connect-SPOService -Url https://[your-tenant]-admin.sharepoint.com.

3
Enable Custom Scripting

Run the following command to allow custom scripting on the specific site: Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0.

4
Apply Metadata via Code or Automation

Copy the files to the target library. Because metadata may still be stripped, build a Power Automate flow or use custom code to map and apply the original metadata values to the newly copied files.

Enable Custom Scripting and Use Automation
Developer Support: If you are not familiar with custom code or creating complex Power Automate flows, consider reaching out to Microsoft Q&A developer forums for specific templates on updating file properties.
Free Microsoft Office alternative

Manage Your Documents Seamlessly with WPS Office

Dealing with SharePoint libraries and complex PowerShell metadata scripts can be highly technical. Creating and editing your daily documents, however, should be simple. WPS Office offers a lightweight, highly compatible alternative to Microsoft Office, allowing you to edit Word, Excel, and PowerPoint files easily and for free.

  1. 1. Download and Install: Visit the official WPS website to download the free installer for your operating system.
  2. 2. Open Your Documents: Launch WPS Office and open the documents you have downloaded from your SharePoint libraries.
  3. 3. Edit and Save: Edit your files using a full suite of familiar tools. Save them locally and upload them back to SharePoint without worrying about format compatibility.
Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx) commonly stored in SharePoint.Free and lightweight, helping you avoid complex setups and heavy software installations.An all-in-one office suite to easily manage PDFs, text documents, spreadsheets, and presentations.Familiar user interface that ensures a zero-learning-curve migration from Microsoft Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why does SharePoint lose metadata when copying files?

When moving or copying files across libraries, custom metadata columns and managed term sets often do not match perfectly behind the scenes. SharePoint's default copy actions sometimes strip this data to prevent schema conflicts or database errors.

Does 'Move to' retain metadata better than 'Copy to'?

Moving files within the same site collection generally retains metadata better than copying, provided the destination library has exactly the same column configurations. However, cross-site moves often experience the same metadata loss as copying.

Can I preserve metadata without using PowerShell?

If you cannot use PowerShell, your best alternative is Microsoft Power Automate. You can build a custom flow utilizing the 'Copy file' action followed immediately by an 'Update file properties' action to map and write the original metadata to the new destination file.