How to move files from OneDrive to SharePoint using Power Automate

Do you want to move files from OneDrive to SharePoint? Keep reading this tutorial to know more on how to move files from OneDrive for Business to SharePoint Online using Power Automate or Flow. We will also check how to move files from SharePoint to OneDrive using Power Automate.

Here we will cover:

  • How to move files from OneDrive to SharePoint flow or Power Automate
  • Copy files from OneDrive to SharePoint flow or Power Automate
  • How to move files from SharePoint to OneDrive using flow or Power Automate
  • Copy files from SharePoint to OneDrive using flow or Power Automate

There are different ways, we can move files from OneDrive for Business to SharePoint or vice versa (SharePoint to OneDrive). Let us check one by one.

Move files from SharePoint to OneDrive using Out of Box Feature

If you are using the SharePoint Online modern experience, we can easily move or copy documents from SharePoint Online to OneDrive or from OneDrive to SharePoint Online by using the Move to or Copy to feature.

The Move to and Copy to are the out of box feature in a modern document library in SharePoint Online.

Open any modern library and select the document, then click on the from the command bar and then you can see the Move to and Copy to options like that. Click any option here.

move files from sharepoint to onedrive
move files from sharepoint to onedrive

If you will select Move to, you can see here, it will ask you to choose the destination where you can move. Either you can select a SharePoint site or if you want to move the document to OneDrive for business, then select Your OneDrive option like below:

move files from sharepoint to onedrive for business
move files from sharepoint to onedrive for business

Now, in your OneDrive, you can select an existing folder or even you can create a new folder by using the New folder like below. Then click on Move here, the document will be moved from SharePoint to OneDrive.

how to move files from sharepoint to onedrive
how to move files from sharepoint to onedrive

If you want to move or copy multiple files, then you can select multiple files from the library and click on the Move to or Copy to button and the rest steps will work as it is.

This is how we can move documents from SharePoint to OneDrive.

Move files from OneDrive to SharePoint (Out of box feature)

Now, let us see how to move files from OneDrive to SharePoint using the out of box feature. This works exactly like SharePoint to OneDrive moving files options.

Open OneDrive for Business from the Office 365 app launcher and then select the files you want to copy to move to SharePoint Online.

Here you can see I have selected multiple files and you can see the Move to and Copy to buttons in the command bar.

move files from onedrive to sharepoint
move files from onedrive to sharepoint

Then you can see, it will display all the SharePoint sites which you have access to. Here you can select a SharePoint site where you want to move the documents to.

move files from onedrive to sharepoint online
move files from onedrive to sharepoint online

Once you select a SharePoint Online site, it will also show you to create a folder inside the default Documents document library. And then click on Move here. Then the documents will be moved to the Documents document library in the SharePoint site.

how to move files from onedrive to sharepoint online
how to move files from onedrive to sharepoint online

This is how we can move documents from OneDrive for business to SharePoint Online.

Move files from OneDrive to SharePoint Power Automate

Now, let us see how to move files from OneDrive to SharePoint using Power Automate or Microsoft flow.

So here, first, we will implement the below logic. Whenever someone uploaded or created a file in OneDrive for business, then the flow will trigger and it will move the document to a SharePoint document library. Move here meaning, we will create the document in the destination and then will delete the source file.

Let us first create the flow and then we will add the login into it.

Login to https://flow.microsoft.com and then sign in with your Office 365 credentials.

Then click on the + Create button to create a flow. Then from the Start from blank, choose the Automated cloud flow option like below:

move files from onedrive to sharepoint flow
move files from onedrive to sharepoint flow

Here provide a flow name and then choose your flow’s trigger, choose When a file is created (OneDrive for Business).

move files from onedrive to sharepoint microsoft flow
move files from onedrive to sharepoint microsoft flow

Once you click on Create, the flow will get created. Here, click on the folder icon and select the Root folder of your OneDrive for Business. If you have subfolders, you can select that also. Or you can directly add the / (backslash) and it represents the root folder of OneDrive for Business.

move files from onedrive to sharepoint site
move files from onedrive to sharepoint site

Then click on the + icon to add a new action into the flow. Search for Get file content using path (OneDrive for Business) flow action and add it.

Here, we need to give carefully the File path. Give the folder and then file path. In this case you can put backslash (/) and then select the File name (OneDrive for Business) property from the Dynamic content. It looks like below.

move files from onedrive to sharepoint power automate
move files from onedrive to sharepoint power automate

Then click on the + icon to add another flow action. And this time we need to create the file in the SharePoint Online document library.

Now, search form Create file (SharePoint) flow action and add into the flow. Here, provide the below details:

  • Site Address: Here, select the SharePoint site where the document library is presented and you want to move the document.
  • Folder Path: Here choose the library name and if it contains a subfolder and you want to store the document, you can choose the folder as well.
  • Fine name: Here I have selected the File name properties from the OneDrive for Business file properties. Basically, whatever the file name and extension in OneDrive, it will create the same in the SharePoint library also.
  • File Content: Here, choose File content that is coming from the previous step and you can see in the Dynamic content.
move files from onedrive to sharepoint using power automate
move files from onedrive to sharepoint using power automate

Once the above step executes, it will create a document in the SharePoint library with the same name as it was in OneDrive for Business.

Now, the last thing we will do is to delete the document from OneDrive for Business. If you want to just copy the document to SharePoint Online from OneDrive, then no need to add the Delete flow action. This flow action required only if you want to move the document to SharePoint Online from OneDrive for Business.

Here click on the + icon to add the next flow action. Search for, Delete file (OneDrive for Business) flow action. Here choose the File identifier from OneDrive for Business Dynamic properties like below:

move file from onedrive to sharepoint using flow
move file from onedrive to sharepoint using flow

This action will delete the file from OneDrive for Business. Then Save the flow and our flow is ready now.

The complete flow looks like below:

copying files from onedrive to sharepoint
copying files from onedrive to sharepoint

Now, we can test the flow. From the top right corner click on Test flor and then choose Manually and click on the Test button like below:

migrate files from onedrive to sharepoint online
migrate files from onedrive to sharepoint online

While the Test is running, open your OneDrive for Business and then upload a document.

move files from onedrive to sharepoint 1

You can come back to the Test screen and you can see all the steps run successfully. Means our flow is has no error.

move files from onedrive to sharepoint online
move files from onedrive to sharepoint online

Now, open the SharePoint Online library and you can see the document will be there.

move file from onedrive to sharepoint online
move file from onedrive to sharepoint online

This is how we can move files from OneDrive for Business to SharePoint Online document library using Power Automate or Microsoft flow.

If the flow will be running, then any time a new file will be created or uploaded to OneDrive for Business, the file will be moved to the SharePoint document library.

Power automate to move files from SharePoint to OneDrive

Now, let us see how to move files from SharePoint to OneDrive using Power Automate or Microsoft flow. This will be the exact opposite of what we did in the above steps.

Here, if user uploads a document to the SharePoint document library, then our flow will trigger and then the document will be moved to the OneDrive for Business.

Let us create the flow first.

Login to https://flow.microsoft.com with your Office 365 credentials. Then click on the + Create button to create a flow. Then from the Start from blank, choose the Automated cloud flow option like below:

move files from sharepoint to onedrive
move files from sharepoint to onedrive

Then in the next screen, provide a flow name, and also choose your flow’s trigger as When a file is created (properties on SharePoint…) and then click on the Create button.

move files from sharepoint to onedrive for business
move files from sharepoint to onedrive for business

Now, the flow will be created and we need to configure the below properties like Select the Site Address and then choose the Library Name. Here I have selected the default Documents library.

move files from sharepoint online to onedrive for business
move files from sharepoint online to onedrive for business

Then click on the + icon to add another flow action. Here search for Get file content and choose Get file content using path SharePoint flow action like below.

Then provide the Site Address and the File Path. The file path is quite important here. Here provide the library name and then the File name with extension, which you can choose from the Dynamic content.

copying files from sharepoint to onedrive
copying files from sharepoint to onedrive

Once we got the file content, now we can create the file in OneDrive for Business. Click on the + icon to add flow action, search for Create file, and choose Create file (OneDrive for Business).

Here provide the OneDrive Folder path, select the Root folder. Then File name as “File name with extension” and File Content, select File Content that we got in the previous flow action.

move file from sharepoint to onedrive
move file from sharepoint to onedrive

In this step, the file will be created in the OneDrive for Business. Next, we need to delete the file from the SharePoint document library. If you want to just copy files, then we do not need to add the Delete file action.

Now, click on the + icon to add a flow action, search for Delete file and then add Delete file SharePoint flow action. Then configure the Delete file action, provide the Site Address and then in the File Identifier, choose Identifier from the Dynamic content like below:

power automate move file from sharepoint to onedrive
power automate move file from sharepoint to onedrive

Now, Save the flow and the flow is ready for testing.

Now, click on the Test button in the top right corner to test the flow.

Like in the other flow, choose Manually option to test the flow and then click on the Test button. Now open the SharePoint document library and then upload documents. Here you can see I have uploaded two documents.

move files from sharepoint to onedrive flow
move files from sharepoint to onedrive flow

You can see the status of the flow, every steps are green, so the flow ran successfully. The green tick symbol means all the steps are completed successfully.

copy files from sharepoint to onedrive
copy files from sharepoint to onedrive

Now, open OneDrive for Business and you can see the two files are moved here.

power automate copy file from sharepoint to onedrive
power automate copy file from sharepoint to onedrive

At the same time when you open the SharePoint document library, you will not see those documents here.

power automate copy file from sharepoint online to onedrive
power automate copy file from sharepoint online to onedrive

This is how we can move files from SharePoint to OneDrive using Power automate or flow.

Video tutorial – Move files from OneDrive for Business to SharePoint

You can also watch the complete video tutorial below, I have uploaded to the EnjoySharePoint YouTube channel.

You may like the following flow tutorials:

In this tutorial, we learned how to move files from onedrive to SharePoint and vice versa using Power Automate or flow.

  • Move files from SharePoint to OneDrive using Out of Box Feature
  • Move files from OneDrive to SharePoint (Out of box feature)
  • Move files from OneDrive to SharePoint Power Automate
  • Power automate to move files from SharePoint to OneDrive
  • Would be good to know how to replace a superseded file with the same name (overwrite) already in the SharePoint library, when moving from OneDrive. My Flow fails when there is already a document there with the same name…I need it to replace the older file with the newer file.

  • >