How to Copy SharePoint Files From One Tenant to Another Tenant Using Power Automate?

While working on Power Automate, one of my clients needed to move files from one SharePoint tenant to another as part of a cross-organization collaboration project. They wanted an automated process to copy files without manual interaction.

In this tutorial, I will show you how to copy SharePoint files from one tenant to another tenant using Power Automate.

Copy SharePoint Files From One Tenant to Another Tenant Using Power Automate

Imagine you are part of a company that is merging with another organization. You must migrate files from a SharePoint document library in one Tenant, i.e., szg52, to a corresponding document library in another, i.e., tsinfotechnologies.

For example, files from the “Marketing Materials” library in Tenant szg52 must be copied to the “Marketing Resources” library in Tenant tsinfotechnologies.

Copy File One Tenant to Another Tenant using Power Automate

Now follow the below steps:

1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

Copy Files From One Tenant to Another Tenant using Power Automate

2. Add Get files (properties only) and provide the below parameters to retrieve all files from the source document library in Tenant szg52:

  • Site Address: Select the SharePoint site address, which, in my case, is PowerAutomateTutorial.
  • Library Name: Select the SharePoint library name, which, in my case, is Marketing Material.
copy files from one sharepoint site to another power automate

3. Add Get file content and provide the below parameters to extract the content of each file retrieved from the “Get files (properties only)” action:

  • Site Address: Select the SharePoint site address, which, in my case, is PowerAutomateTutorial.
  • File Identifier: Provide an Identifier from the dynamic content of Get files (properties only).

It will automatically add a For each action.

power automate migration tenant to tenant

4. Inside For each loop, add the Create file action from the SharePoint connector, and before you provide the site address, click Change the connection.

How do I move files from one SharePoint tenant to another using Power Automate

5. Then click Add new -> Sign in to Tenant tsinfotechnologies using appropriate credentials.

Copy Files between SharePoint Sites in different Tenants using Power Automate

6. After that, in the “Create file” action, enter the following parameters to create the file in the target library within the Tenant‘s tsinfotechnologies.’

  • Site Address: Select the SharePoint site URL from the Tenant tsinfotechnologies.
  • Folder Path: Select the folder path in the Marketing Resources library where you want to store the files.
  • File Name: Use the File Name with Extension dynamic content from Get files (properties only):
@{item()?['{FilenameWithExtension}']}
  • File Content: Use the File Content dynamic content from the Get file content action.
@{body('Get_file_content')}
Power Automate Copy or move folder to another sharepoint tenant

Run the Flow to Copy SharePoint Files From One Tenant to Another Tenant

Now, click save and run the flow manually after it runs successfully. Then, go to the tsinfotechnologies SharePoint library (Marketing Resources), and you will see that the files have been copied.

How to Copy Files One Tenant to Another Tenant using Power Automate

Conclusion

In this tutorial, I explained how to automate copying files from one SharePoint tenant to another using Power Automate. We covered creating an Instant Cloud flow, retrieving files from the source document library in Tenant szg52, extracting their content, and then creating the files in the target document library in Tenant tsinfotechnologies while switching credentials between tenants.

Additionally, use the trigger if you need to copy a single file instead of multiple files. When a file is created or When a file is created or modified (properties only), use the trigger instead of manually triggering the flow. After setting up the Create file action, change the connection to the target tenant (tsinfotechnologies) and provide the appropriate file path, name, and content.

You may also like:

>
Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial

FREE Power Platform Tutorial PDF

Download 120 Page FREE PDF on Microsoft Power Platform Tutorial. Learn Now…