Others

How to Copy SharePoint Files Across Site Collections in SharePoint 2019

Jason MillerJason Miller Nov 3, 2026 869 views

Question details

The user is attempting to copy files across different site collections using JavaScript but encounters a failure when the destination is outside the current site collection.

How to Copy SharePoint Files Across Site Collections in SharePoint 2019
Product
SharePoint Server 2019
Device & OS
not provided
Scenario
Developing or scripting cross-site-collection file operations using the SharePoint JavaScript Object Model.
Observed behavior
The SP.MoveCopyUtil.copyFile JavaScript method successfully copies files within the same site collection but fails when the destination URL belongs to a different site collection.
Before you start

Before attempting cross-site collection operations, ensure you have appropriate Read permissions on the source site collection and Contribute or Edit permissions on the destination site collection.

Solution 1Recommended

Seek Assistance in the Microsoft Q&A Forum

Because this issue involves server-level SharePoint 2019 JavaScript operations and cross-site architectures, Microsoft's dedicated developer forum is the best place for an advanced technical resolution.

Cross-site collection operations via JSOM (JavaScript Object Model) are often restricted by SharePoint's security context and architectural boundaries. Resolving this typically requires migrating to the SharePoint REST API's CreateCopyJobs endpoint or utilizing server-side solutions.

1
Gather your environment details

Collect necessary information including your specific SharePoint Server 2019 build version, the exact source and destination URLs, and your current user permission levels.

2
Prepare your code and errors

Copy your exact SP.MoveCopyUtil.copyFile JavaScript implementation and any specific error messages or correlation IDs shown in the browser console.

3
Visit the Microsoft Q&A platform

Navigate to the official Microsoft Q&A forum at https://docs.microsoft.com/en-us/answers/index.html to reach SharePoint development experts.

4
Post your detailed question

Submit your inquiry under the 'SharePoint Server 2019' or 'SharePoint Development' tag, avoiding standard Microsoft 365 end-user forums, to ensure it reaches the right technical audience.

Seek Assistance in the Microsoft Q&A Forum
Provide Detailed Context: When posting in developer forums, always clarify that you are on SharePoint Server 2019 (on-premises) rather than SharePoint Online, as the supported JavaScript methods differ significantly.
Free Microsoft Office alternative

Looking for a Reliable, Free Office Suite? Try WPS Office

While managing SharePoint Server configurations requires dedicated Microsoft development resources, for your everyday document creation and editing needs, WPS Office offers a lightweight, highly compatible alternative to Microsoft Office. It integrates Writer, Spreadsheet, Presentation, and PDF tools in one seamless interface.

  1. 1. Download the installer: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Install the software: Run the downloaded file and follow the quick on-screen instructions to install the suite.
  3. 3. Open and edit your files: Launch WPS Office and immediately start opening your existing Microsoft Office documents without format loss.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Free and lightweight, consuming significantly fewer system resources than heavy enterprise suites.All-in-one software design allows you to view and edit multiple document types in a single tabbed window.Familiar ribbon user interface makes switching from Microsoft Office incredibly seamless.
microsoft office alternative - wps office

Frequently Asked Questions

Why does SP.MoveCopyUtil.copyFile fail across site collections?

In SharePoint, JavaScript Object Model (JSOM) operations are generally restricted to the current site collection context for security reasons. The API cannot seamlessly authenticate and execute methods across different site collection boundaries, resulting in an access or context error.

Can I use Power Automate to copy files across SharePoint site collections?

Yes. If you are using SharePoint Online or have an on-premises data gateway configured for SharePoint Server 2019, Power Automate provides native 'Copy file' actions that easily handle authentication and transfer across different site collections.

Are cross-site operations supported in the SharePoint REST API?

Yes, modern SharePoint environments support cross-site file copying using the REST API's CreateCopyJobs endpoint. This endpoint is specifically designed to handle site-to-site operations much better than older JSOM methods.

How can I verify my permissions for cross-site copying?

Navigate to the Site Settings of both the source and destination site collections. Under 'Site permissions', select 'Check Permissions' and enter your username. You must have at least 'Read' access on the source and 'Contribute' access on the destination.