How to copy a folder from SP online to SP onprem using PowerShell

Aase Nomad 246 Reputation points
2022-04-11T14:42:41.45+00:00

I have a folder call "General" in my SharePoint Online site. It's about 16GB and a lot of nested folders inside it. I wanted to copy that folder(including all the nested folders) to a different SharePoint Onprem site while it preserved all the data such as created date, modified date..etc using PowerShell so just wondering if anybody know where I might be able to find a PowerShell script that does that?.

Any suggestion will be really appreciated.

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,481 Reputation points Microsoft External Staff
    2022-04-12T06:28:02.497+00:00

    Hi @Aase Nomad ,
    As far as I know, Microsoft does not provide a method that moving files from SharePoint Online to on-premises environment. You will need to use a 3rd party tool such as ShareGate.

    While Microsoft supports and encourages open-source software development, it does not provide technical support for the softwares from third parties, nor does it guarantee that the software will work as described.


    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.



  2. sadomovalex 3,636 Reputation points
    2022-04-19T15:13:30.973+00:00

    if this is one time operation then you may try this: open parent doclib in SPO in Explorer and copy it manually to local file system (like in regular Windows Explorer with copy/paste) or use Sync command to do the same: View SharePoint files in File Explorer. After that open target doclib in SP onprem also in Windows Explorer and paste folder there from your local file system via WebDav.

    0 comments No comments

Your answer

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