Hi @rameez hasan ,
It is not supported to convert the entire classic site to modern site.
But you could convert classic page to modern page using PowerShell.
Convert a Classic Page to Modern Page:
$SiteURL=https://xxx.sharepoint.com/sites/xxx
$ClassicPageName = "home.aspx"
#Connect to Site
Connect-PnPOnline $SiteURL -Interactive
#Convert Classic page to Modern page
ConvertTo-PnPPage -Identity $ClassicPageName -AddPageAcceptBanner
Convert All Classic Pages to Modern Page:
#Set Parameters
$SiteURL=https://xxx.sharepoint.com/sites/xxx
#Connect to Site
Connect-PnPOnline $SiteURL -Credentials (Get-Credential) #-Interactive
#Get All Pages from "Site Pager" Library
$Pages = Get-PnPListItem -List SitePages -PageSize 500
ForEach($Page in $Pages)
{
#Get the page name
$PageName = $Page.FieldValues.FileLeafRef
Write-host "Converting Page:"$PageName
#Check if the page is classic
If($Page.FieldValues["ClientSideApplicationId"] -eq "b6917cb1-93a0-4b97-a84d-7cf49975d4ec")
{
Write-host "`tPage is already Modern:"$PageName -f Yellow
}
Else
{
#Conver the classic page to modern page
ConvertTo-PnPPage -Identity $PageName -Overwrite -TakeSourcePageName -AddPageAcceptBanner
Write-host "`tPage Converted to Modern!" -f Green
}
}
Note: Don’t forget to replace the parameters with your own.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.