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

Aase Nomad 246 Reputation points

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.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,271 questions
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,002 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,757 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,427 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 32,476 Reputation points Microsoft Vendor

    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,626 Reputation points

    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