How to Copy a Large SharePoint Online Library with PowerShell
Question details
The user needs a reliable method to copy about 1 TB between SharePoint Online document libraries and replace destination files only when the source version is newer.

- Product
- SharePoint Online / Microsoft 365
- Device & OS
- not provided
- Scenario
- Migrating a large document library between two modern SharePoint Online sites.
- Observed behavior
- Manual Copy to is not suitable for 1 TB; the migration must enumerate files, compare last-modified dates, and copy only newer source files.
Before running a SharePoint migration script, confirm that the PnP.PowerShell module is installed and that the account has at least read access to the source library and contribute access to the destination library.
Use a PowerShell migration script to copy only newer files
Best for large libraries where you need a repeatable, resumable transfer that compares last-modified dates and skips unchanged or newer destination files.
A PowerShell script can page through large lists, compare the Modified property for each source and destination item, and call a copy command only when the source file is newer. This reduces unnecessary traffic and makes the migration easier to audit.
Open Windows PowerShell as administrator, run Install-Module PnP.PowerShell -Scope CurrentUser -Force, then run Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/source" -Interactive to authenticate to SharePoint Online.
Use Get-PnPListItem -List "SourceLibrary" -PageSize 500 to enumerate source files, including the Modified and FileRef fields, and repeat the same call against the destination library for comparison.
For each source item, find the matching destination item by its relative URL. If the source Modified date is newer than the destination Modified date, run Copy-PnPFile -SourceUrl $source.FileRef -TargetUrl $destUrl -Overwrite; otherwise skip the file.
Wrap the loop in try/catch, append each result to an array, and use Export-Csv to record copied, skipped, and failed files so the script can be re-run safely.

Use the SharePoint Copy to command for smaller manual transfers
Useful for a small set of folders or files when you do not need automated date comparison or resumable processing.
Use WPS Office to edit the Office files you migrate to SharePoint Online
WPS Office does not manage SharePoint Online migrations, but it offers a free, lightweight way to open, edit, and save the Word, Excel, and PowerPoint files you move between Microsoft 365 and SharePoint document libraries.

Frequently Asked Questions
Can I copy 1 TB between SharePoint Online libraries with the Copy to command?
You can, but it is not recommended for 1 TB. A PowerShell script or migration tool is better because it can enumerate files in batches, compare last-modified dates, skip unchanged files, and produce a log for resuming failed or timed-out transfers.
Which PowerShell module should I use for SharePoint Online library migration?
Use the PnP.PowerShell module. Install it with Install-Module PnP.PowerShell -Scope CurrentUser -Force, then connect with Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/source" -Interactive.
How do I copy only files whose source version is newer?
Retrieve the source and destination list items with Get-PnPListItem, compare their Modified properties by relative URL, and call Copy-PnPFile -Overwrite only when the source Modified date is newer than the destination Modified date.
What permissions are required to migrate a SharePoint Online document library?
The account running the script normally needs at least read access to the source library and contribute or edit access to the destination library. If the script uses application permissions, the app must be granted the equivalent SharePoint Sites permissions.
Will WPS Office move my SharePoint Online document library for me?
No. WPS Office is an Office suite for editing files, not a SharePoint migration service. Use SharePoint Online PowerShell, Microsoft 365 tools, or a dedicated migration tool to move the library, and WPS Office to open and edit the resulting Office files.




