Automatic Copy Files From Sharepoint Site Tenant A to Sharepoint Site Tenant B

Minh Ngà 0 Reputation points
2025-11-15T00:38:12.33+00:00

Hi Guys,

I have a situation like this:

My comany have two MS365 Tenants. They are Tenant A and Tenant B

I need to Automatically/Instantly Copy New Files/ Edit Files from which saves at Library Sharepoint Site Tenant A to Library Sharepoint Site Tenant B.

My company Policies requires some things:

  • Do not use site asset to share this site to user tenant B
  • Do not want user to sync site shorcut to onedrive on pc

And most importantly that These excel files have large capacity in GB and are stored in complex structured directory trees inside the sharepoint site. For example, directory A has about 10 sub-directories, in each of the 10 sub-directories there are many more directories of excel files scattered on it.

Base on my experience and my knowledge of Microsoft 365, i use Power Automate on Tenant B and create a automatic flow using Get files content >> Create Files

But in my experience, Power Automate can only get files under 100MB and the file saving folder path is no more than 400 characters.

Please suggest me ways that still use Microsoft tools to be able to do this.

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-15T00:38:34.1066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To automatically copy files from a SharePoint site in Tenant A to a SharePoint site in Tenant B while adhering to your company's policies, you can consider using Microsoft Power Automate (Flow) with some adjustments to accommodate the limitations you've mentioned. Here are some suggestions:

    1. Use Power Automate with Batch Processing: Since Power Automate has limitations on file size and path length, consider breaking down the file transfer into smaller batches. You can create flows that trigger on a schedule (e.g., every hour) to check for new or modified files in Tenant A and then copy them to Tenant B. This way, you can manage larger files by processing them in smaller chunks.
    2. Utilize SharePoint API: If Power Automate's limitations are too restrictive, you could consider using the SharePoint REST API or Microsoft Graph API to programmatically handle file transfers. This would require some development work but can provide more flexibility and control over file handling, including larger files and complex directory structures.
    3. Consider Azure Logic Apps: If your organization has access to Azure, Azure Logic Apps can be a more robust alternative to Power Automate. It allows for more complex workflows and can handle larger files and more intricate directory structures.
    4. Manual Migration for Large Files: For particularly large files that exceed Power Automate's limits, consider a manual migration approach for those specific files, while automating the transfer of smaller files.
    5. Monitor and Optimize: Regularly monitor the performance of your flows or API calls to ensure they are working as expected and optimize them as necessary.

    By combining these approaches, you should be able to effectively manage the transfer of files between the two tenants while adhering to your company's policies.


    References:

    0 comments No comments

  2. Austin-H 6,990 Reputation points Microsoft External Staff Moderator
    2025-11-15T03:38:22.65+00:00

    Hello @Minh Ngà
    Thank you for posting question to Microsoft Q&A Forum.
    According to your description, may I have your confirmation again whether your requirement is for a real-time, continuous synchronization of files between Tenant A and Tenant B, or if a one-time migration of all existing files would be sufficient?
    Based on my research, Microsoft does not currently offer a built‑in app that continuously syncs large files between two different Microsoft 365 tenants in real time.
    Regarding on your request, I am thinking of suggestion to build an integration app that uses Microsoft Graph to: detect new/updated files in the SharePoint library on Tenant A, and stream those files into the target library on Tenant B using Graph upload sessions (chunked, resumable), which supports large files (please note that the limit is 250 GB for OneDrive file).

    The idea of its structure:

    1. Register a single multi‑tenant Microsoft Entra app (or two separate apps), grant application permissions and admin consent in both tenants.
    2. Use Sites.Selected to scope the app to only the specific site(s)/library you intend to mirror (grant Read/Write via the Sites.Selected endpoint). This avoids granting blanket access like Sites.ReadWrite.All across the whole tenant.
      Reference on how to upload files to SharePoint using Microsoft Graph: https://learn.microsoft.com/en-us/answers/questions/2006537/how-to-use-graph-api-to-upload-files-to-sharepoint
    3. The application detects changes in Tenant A and subscribes to Graph change notifications for driveItem on source library:
      Reference on change notifcation:
      https://learn.microsoft.com/en-us/graph/change-notifications-overview
    4. For each notifcation, request the item's downloadUrl and stream it into an Upload session to Tenant B's library.
      Reference on createUploadSession:
      https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0
    5. Copying files from Tenant A to B also means that you need to have same folder structure target library tenant
      Reference for driveItem: Copy (Please search for "parentReference" keyword)
      https://learn.microsoft.com/en-us/graph/api/driveitem-copy?view=graph-rest-1.0#request-body
    6. If you would like to rename or move, consider using PATCH with Graph's driveItem update APIs.
      Reference: https://learn.microsoft.com/en-us/graph/api/driveitem-update?view=graph-rest-1.0&tabs=http

    If your request is different from what I've mentioned - which means you prefer to do one-time migration, then Microsoft provides option such as: Cross-Tenant Migration (CTM) – moves entire SharePoint sites with permissions and version history: https://learn.microsoft.com/en-us/microsoft-365/fasttrack/cross-tenant-migration#migration-to-sharepoint-and-onedrive
    In conclusion, if real-time synchronization is a primary requirement, the recommended approach is to build a custom solution using Microsoft Graph and Azure services, as this is the only Microsoft-supported method for handling large files and complex folder structures in an automated way.

    I hope this information is helpful. Please let me know if you have any further questions


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Minh Ngà 0 Reputation points
    2025-11-15T05:55:41.48+00:00

    Hi Austin-H My boss 's requirement is for a real-time, continuous synchronization of files between Tenant A and Tenant B


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.