Forum Discussion

harishpatil's avatar
harishpatil
Copper Contributor
Apr 01, 2021

Convert classic home page to modern home page

Hi Team,

 

I am trying below code to convert classic page to modern page. But getting  below error.

Kindly suggest the resolution for the same.

 

Code:

$modernPage = ConvertTo-PnPClientSidePage -Identity $page.FieldValues["FileLeafRef"] -Overwrite

 

Error: The 'ConvertTo-PnPClientSidePage' command was found in the module 'SharePointPnPPowerShellOnline', but the module could not be loaded. Fo
r more information, run 'Import-Module SharePointPnPPowerShellOnline'.

 

Thanks,

Harish Patil

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    harishpatil I don't do any of that, I just rename the current homepage to home-original, create a new page called home and set it as the default. That page and all pages that are created afterwards are in the modern experience.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

    • harishpatil's avatar
      harishpatil
      Copper Contributor
      Hi RobElliott,

      Yes, we can do that way. We can rename existing one and crate new site page. It is working fine.

      We are from migration team. We have migrated SP 2013 to SPO that time home page automatically get classic view. On migrated page there are some webparts and some data. So how we can get those on new home page?

      We need same data on new page so for that we are trying mentioned code. Kindly suggest how we can do?

      Thanks,
      Harish Patil

Resources