Convert classic home page to modern home page

%3CLINGO-SUB%20id%3D%22lingo-sub-2249391%22%20slang%3D%22en-US%22%3EConvert%20classic%20home%20page%20to%20modern%20home%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2249391%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Team%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20below%20code%20to%20convert%20classic%20page%20to%20modern%20page.%20But%20getting%26nbsp%3B%20below%20error.%3C%2FP%3E%3CP%3EKindly%20suggest%20the%20resolution%20for%20the%20same.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ECode%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%24modernPage%20%3D%20ConvertTo-PnPClientSidePage%20-Identity%20%24page.FieldValues%5B%22FileLeafRef%22%5D%20-Overwrite%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EError%3A%3C%2FSTRONG%3E%26nbsp%3BThe%20'ConvertTo-PnPClientSidePage'%20command%20was%20found%20in%20the%20module%20'SharePointPnPPowerShellOnline'%2C%20but%20the%20module%20could%20not%20be%20loaded.%20Fo%3CBR%20%2F%3Er%20more%20information%2C%20run%20'Import-Module%20SharePointPnPPowerShellOnline'.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EHarish%20Patil%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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

2 Replies

@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

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