12-07-2017 01:50 PM
12-07-2017 01:50 PM
One of the items I've been trying to tackle is how to move a site page between site collections (two different communication sites). In the same Site Pages library, this is simple. The usage case scenario here would be if we have a designated "UAT" environment where users modify their site pages to their exact specifications. Right now the only way I know of is to manually recreate this page in the destination site.
I've been working through the features of the Office DEV PnP PowerShell framework using the ClientSidePage objects, but it doesn't appear through development that this functionality is quite there to read a site page, then add a site page at a new target based on that. Also tried varying other methods of moving files between sites to see if it would 'magically' just work with no luck.
Has anyone ever tried or have come up with a solution similar to that in which I'm seeking?
FYI: Sharegate has been tried and also does not have that capability as they probably base their migrations on what's available to use already.
12-11-2017 09:55 AM
Full disclosure, I work for Sharegate :) The tool should be able to perform your action without any issues. Can you send an email to the support team? They'd love to take a look with you to identify the problem. Good luck!
08-01-2018 12:52 AM - edited 08-01-2018 12:56 AM
did you find a solution for this problem. I face the same issue at the moment. I've tried ShareGate (access denied with global admin, site coll admin, etc.) and looked at PnP and PowerShell, but there doesn't seem to be a way to copy or move a site page from the pages library to another site collection within the same tenant. The source site is a modern page of type communication, the target site is a modern page of type team site.
Thank you for any response.
12-19-2018 03:40 PM
Hi @Alexander Tihme,
PnP worked for me :)
My approach was simple. I downloaded the page as a file to my local machine using;
Get-PnPFile -Url '/sites/intranet/SitePages/myfile.aspx' -Path 'C:\Pages' -Filename 'myfile.aspx' -AsFile
Then upload to the target site using;
Add-PnPFile -Path 'C:\Pages\myfile.aspx' -Folder "SitePages"
You will have to change some Webpart settings after the file is uploaded.
Thanks to PnP Team
02-28-2019 11:19 PM
I am getting this error. Have someone resolved this?
Get-PnPFile : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord,
and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly,
or contact Microsoft Customer Support Services.
10-08-2019 02:20 PM
The command you shared is to save page and upload it to same site collection under sitepages folder?