Copy Site Page to another Sharepoint in the same tenant

Jacobo Garrido 0 Reputation points
2023-09-29T15:33:26.3533333+00:00

Hi Team,

We need to be able to copy a Site Page workspace to other Sharepoint, it will be very useful for me and I've Admin permissions in both sides. Would it be possible? What would be the steps?

The Original URL is "https://xxxx46wtf.sharepoint.com/:u:/r/sites/one-worksplace-hollywood/SitePages/Home.aspx?csf=1&web=1&e=fFevgz"

Thanks in advance.

Best Regards

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,596 Reputation points Microsoft External Staff
    2023-10-02T08:23:25.2166667+00:00

    Hi @Jacobo Garrido ,

    You can use PnP PowerShell to copy a modern page to another site:

    #Parameters
    $SourceSiteURL = "https://tenant.sharepoint.com/sites/sitename1"
    $DestinationSiteURL = "https://tenant.sharepoint.com/sites/sitename2"
    $PageName =  "XXX.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
    

    This PowerShell script export-imports a given page and all its web parts, contents, etc.

    This is my test:

    10021

    User's image

    User's image


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.