Forum Discussion
Jarrett Haynes
Dec 07, 2017Copper Contributor
Copy Site Pages (ClientSidePage) Site to Site
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 s...
Alexander Tihme
Aug 01, 2018Brass Contributor
Hi Jarrett Haynes, Mia Lohé Chung
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.
Alex
- Prabath FonsekaDec 19, 2018Copper Contributor
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
Cheers!
Prabath
- JoostvdLindenJan 06, 2020Brass Contributor
Looks like a proper business process flow
- PankajranaOct 08, 2019Copper Contributor
The command you shared is to save page and upload it to same site collection under sitepages folder?
- Nirav PatelMar 01, 2019Copper Contributor
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.