How to Copy SharePoint Files Across Site Collections in SharePoint 2019
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.

- 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 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.
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.
Collect necessary information including your specific SharePoint Server 2019 build version, the exact source and destination URLs, and your current user permission levels.
Copy your exact SP.MoveCopyUtil.copyFile JavaScript implementation and any specific error messages or correlation IDs shown in the browser console.
Navigate to the official Microsoft Q&A forum at https://docs.microsoft.com/en-us/answers/index.html to reach SharePoint development experts.
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.

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. Download the installer: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install the software: Run the downloaded file and follow the quick on-screen instructions to install the suite.
- 3. Open and edit your files: Launch WPS Office and immediately start opening your existing Microsoft Office documents without format loss.

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.




