There have been a lot of discussions around this topic but there's no working code solution for copying pages with web parts across site collection. Everyone suggest using SP designer. Is there any csom or REST api solution to achieve this? I have tried LimitedWebPartManager class, export/import and creating the web part xml programmatically but none of this works for 2013 On-prem.
1 Answer
I faced a similar problem. Due to timeout I decided to use a PowerShell script, which calls the REST API in my CSOM C# application. Not ideal, but it works.
The script ist from:
https://code.msdn.microsoft.com/office/Clone-a-page-with-all-c6512b5b
-
This script works for copying files within same environment (or within same site collection). I need to copy from On-prem to online site collection. thanks anyways.– Adi SCommented Aug 25, 2017 at 13:35