How to Copy SharePoint Files to Another Library with Metadata
Question details
The user needs to copy files from one SharePoint library to another without losing custom and managed metadata values.

- 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.
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.
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.
Install and open the SharePoint Online Management Shell as an administrator on your computer.
Connect to your tenant by running the command: Connect-SPOService -Url https://[your-tenant]-admin.sharepoint.com.
Run the following command to allow custom scripting on the specific site: Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0.
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.

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. Download and Install: Visit the official WPS website to download the free installer for your operating system.
- 2. Open Your Documents: Launch WPS Office and open the documents you have downloaded from your SharePoint libraries.
- 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.

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.




