Category
[x] Bug
[ ] Enhancement
Problem Area
[ ] Page Transformation: Error during the setup/use of the Page Transformation UI solution (did you check our troubleshooting guide?)
[ ] Page Transformation: Error during the use of page transformation from PnP PowerShell
[ ] Page Transformation: Error during the use of page transformation from .Net
[x] Page Transformation: Page is not looking correct after transformation
[ ] Modernization Scanner: something went wrong...
Expected or Desired Behavior
Classic page's content has to be retained after conversion using ConvertTo-PnPClientSidePage -Identity "page.aspx" -AddPageAcceptBanner -TakeSourcePageName
Observed Behavior
Classic page is not retaining any data
Steps to Reproduce
It is randomly occuring in homepages
@PriyankaDevi510 : we need more details to understand what goes wrong:
Hey @jansenbe
The script is neither showing error nor terminated while running. I tried using Get-PnPException -All. No exception was thrown. It is a wiki page, and it is checked in. During page transformation, log file was created using -LogFolder "D:\" and 鈥揕ogVerbose and attached the same.
Previous_home-content missing- Page-Transformation-Report-9-17-2019-12-08-58-PM.txt
Hey @jansenbe
Any update on this issue?
@PriyankaDevi510 I have some questions, if that's ok:
Sorry for the barrage of questions.
Thx @pkbullock .
@PriyankaDevi510 : The shared log is not providing enough information to reproduce this, so we need to try to understand where the difference is between a working home page and one having this issue. Since we're using OOB API's to handle the page rename this seems to be more of a platform issue versus an issue in page transformation...but without a clean repro it's really hard to fix this.
On how many of the home pages do you see this?
Can you reproduce it somehow?
Hey,
The home page has Checkin/checkout enabled. And they dont have any custom code or closed webparts. They just have basic XSLT /newsfeed webparts. We are able to reproduce this issue and also we find another previous_home.aspx with the original content in recycle bin. This issue is persisiting frequently in most of the home pages.
Hi @jansenbe
Any update on this issue
Hi @PriyankaDevi510 ,
Sorry for the delays in this, I'm currently travelling and have limited time to dig into this. Should back in "normal" mode next week. It's good that you can repro this, are you willing to have a (Teams) meeting where we jointly can debug this?
Hi @PriyankaDevi510 ,
I've been looking into this based upon the information in this thread...and for now I do not immediately see where it goes wrong. The log that you showed previously shows that the steps in the swappages routine are processed without error. The following logic is applied.
As you see we're not deleting Previous_Home.aspx, so I'm a little bit puzzled here. I'll prep a team site for testing, with checkin/checkout and see if I can repro. If I'm not able to repro then other options can be:
Hi @PriyankaDevi510 ,
I've been testing this and when the page is checked out by the person running the page transformation then things are working fine. If however the page was checked out then swap pages is not able to fully finalize...but still it's keeping the content. This is what I get as output:

Can you confirm that the home pages that failed were checked out?
Are you by any chance running the transformation using app-only versus user credentials?
Hey @jansenbe
The pages are not checked out
Transformation is done using user-credentials
Hey @jansenbe
We would like to do a joint debug session. Kindly let us know your availability..
Hey @PriyankaDevi510,
Please drop me a mail on [email protected] so we can setup a meeting.
Hi @PriyankaDevi510 ,
The root cause of this is because programmatically created wiki pages loose their webparts on a copy operation. This is due to remote API's not being able to use the web part storage key, see https://github.com/SharePoint/PnP-Sites-Core/issues/2052 for more details.
The solve this issue I'm rewriting the swap pages logic to use the Move operation instead of the Copy operation. This fix will be included in the next release.
Fix committed.
@jansenbe awesome find. Nice one.
Hey Bert,
Thanks much for the quick turnaround! Just curious to know about the navigation links' behavior when Moveto operation is used
When I originally developed the swap pages logic these links were dropped, but now they're renamed by the move operation...and I just rename the links back. So links are retained with the new swap pages logic. I also did some work to ensure that when we move the original source page to "previous_page" we keep the page author/editor/modified/created information.
That sounds great! Thanks Bert. Closing the issue
FYI: the next PnP PowerShell version (3.14.1910.1) will be available today. This should solve your issue, if not please open a new issue so can further work on this.
tagging @PriyankaDevi510 so this pops up
Most helpful comment
Fix committed.