[BUG] Export-PnPPage doesn't create info about the client side page if certain section backgrounds are used.
Reporting an Issue or Missing Feature
If you use Export-PnPPage on a page that has a section background other than the first few very simple ones the exported xml file does not include a client side page object.
Expected behavior
When you run Export-PnPPage -Force -Identity $PageName -Out $migrationFileLocation -PersistBrandingFiles you should generate a file that includes all of the info to restore the page using Invoke-PnPSiteTemplate -Path $migrationFileLocation
Actual behavior
You get an xml file without the clientsidepage section
Steps to reproduce behavior
Export-PnPPage -Force -Identity $PageName -Out $migrationFileLocation -PersistBrandingFiles
What is the version of the Cmdlet module you are running?
3.1.0
Which operating system/environment are you running PnP PowerShell on?
- [X] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify
I've just hit this too. Have you worked out what aspect of the background causes it?
Having the same issue as well. Would appreciate if this can be fixed ASAP.
I hate to be the one who moans about something that a lot of people do for free, but copying pages between sites is as pretty fundamental as you get for a SharePoint management tool. Why is this still an issue one PnP v3? I'm on a major project and this is causing loads of extra work. Sometimes it feels like developers for Microsoft get fixated on the new 'cool' stuff and forget about fixing the basics which are way more important to most people
I hate to be the one who moans about something that a lot of people do for free, but copying pages between sites is as pretty fundamental as you get for a SharePoint management tool. Why is this still an issue one PnP v3? I'm on a major project and this is causing loads of extra work. Sometimes it feels like developers for Microsoft get fixated on the new 'cool' stuff and forget about fixing the basics which are way more important to most people
We are feeling SharePoint online gone downhill in last few years. I've been raised at least five tickets with Microsoft in last year or so, related to SharePoint. Been working with MS tech for nearly 20 years, I've not raised five tickets in first 19 years. PnP is always catching up with SharePoint deployments, Power Platform doesn't work properly with SharePoint, only 12 lookup columns supported, Form customisation nearly impossible (miss Nintext forms).
We are feeling SharePoint online gone downhill in last few years. I've been raised at least five tickets with Microsoft in last year or so, related to SharePoint. Been working with MS tech for nearly 20 years, I've not raised five tickets in first 19 years. PnP is always catching up with SharePoint deployments, Power Platform doesn't work properly with SharePoint, only 12 lookup columns supported, Form customisation nearly impossible (miss Nintext forms).
Hello guys, I have the same issue. I ran into the same issue today. Trying to export the page with.
Export-PnPPage Home.aspx
It is returned empty until I remove the background from one section on the canvas. When the background is removed, the Page is correct. Now I can Invoke-PnPSiteTemplate to another site.
Hello guys, I have the same issue. I ran into the same issue today. Trying to export the page with.
Export-PnPPage Home.aspxIt is returned empty until I remove the background from one section on the canvas. When the background is removed, the Page is correct. Now I can Invoke-PnPSiteTemplate to another site.
Thank you good sir! Same issue for me but your workaround was spot on.
From my end it appears any of the strong/solid colored backgrounds will work, but choosing any of the faded background will result in the page returning empty with Export-PnPPage.
I did not end up testing any uploaded background images.
Have just encountered this issue also - nearly SIX months, and no answer.
- I've checked the listItem properties - and the data within $i.FieldValues.CanvasContent1
- Compared against a page WITH the background - and WITHOUT
- There's a new section added "data-sp-webpartdata"
- This is a JSON-encoded section, related to 'zoneBackground'
- This is the bit that's causing issues - unclear WHY, as yet
Looking further into the code - it looks like the issue is probably within the FRAMEWORK ;
https://github.com/pnp/pnpframework/blob/692848047f334a6b231ab2d15baf53e44b7eb187/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ClientSidePageContentsHelper.cs
Hello guys, I have the same issue. I ran into the same issue today. Trying to export the page with.
Export-PnPPage Home.aspxIt is returned empty until I remove the background from one section on the canvas. When the background is removed, the Page is correct. Now I can Invoke-PnPSiteTemplate to another site.Thank you good sir! Same issue for me but your workaround was spot on.
From my end it appears any of the strong/solid colored backgrounds will work, but choosing any of the faded background will result in the page returning empty with
Export-PnPPage.I did not end up testing any uploaded background images.
===============
The issue looks to be resolved - I used the latest DEV branch (in Visual Studio 2022) - and it works !
Also - I then tried the latest NIGHTLY build of PNP.PowerShell (3.1.172). And it works ! ✅
There have been a lot of changes over the last six months - since 3.1.0 was released.
-
Check your version of PNP PowerShell ; Get-Module -Name PnP.PowerShell -ListAvailable | select Name, Version
-
It will probably be 3.1.0
-
Update to use the newer release (3.1.172)
-
Uninstall first ; uninstall-Module -Name "PnP.PowerShell"
-
Then the nightly build ; Install-Module PnP.PowerShell -AllowPrerelease -SkipPublisherCheck
HTH