Two way Sync between SharePoint online and SharePoint 2019 document libraries

john john 926 Reputation points

We have 2 SharePoint environments; SharePoint online and SharePoint on-prem 2019. Each environment contain 40 libraries. and we want to sync the 2 environments, so if a files got added,edited or deleted from on-prem it should get sync in the online and the other way (from on-line to onprem). we can do this in scheduled basis.

So is there any available power shell scripts or c# code which we can use to accomplish this task?

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,569 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,796 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 21,366 Reputation points Microsoft Vendor

    Hi @john john ,
    According to my research, there is no way to do this directly.
    But there are 2 workarounds for your reference:

    1. Use Hybrid Search
      With Hybrid Search, users in both environments can search and see all documents without having to synchronize, and they can know if a document has been created, modified, or deleted.
      For more information, please refer to this article.
    2. Use OD4B
      Both SharePoint Online and SharePoint 2019 support OD4B, and manual synchronization can be performed with the help of OD4B as a tool.
      For more information, please refer to this article.

    Yanli Jiang


    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.