0

How can I backup my SharePoint pages resided in the Site pages library of my Communication site using PnP PowerShell?

6

1 Answer 1

1

PnP PowerShell available to copy a modern page to another site:

#Parameters
$SourceSiteURL = "https://crescent.sharepoint.com/sites/marketing"
$DestinationSiteURL = "https://crescent.sharepoint.com/sites/branding"
$PageName =  "About.aspx"
 
#Connect to Source Site
Connect-PnPOnline -Url $SourceSiteURL -Interactive
 
#Export the Source page

    $TempFile = [System.IO.Path]::GetTempFileName()
    Export-PnPPage -Force -Identity $PageName -Out $TempFile
     
    #Import the page to the destination site
    Connect-PnPOnline -Url $DestinationSiteURL -Interactive
    Invoke-PnPSiteTemplate -Path $TempFile

Reference: https://www.sharepointdiary.com/2020/07/sharepoint-online-copy-pages-to-another-site-using-powershell.html#ixzz7y5JXpR5k

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.