In this post we look at three different ways you can copy a page from one SharePoint site to another.
The copy/ move features within SharePoint Online were introduced a few years ago, and although they are pretty good, aren’t without their limitations – something I wrote about in 2021. One such limitation is the inability to be able to copy or move site pages from one SharePoint site to another – a frequent request of users and of the SharePoint community to Microsoft, but so far nothing has been implemented.
I’m going to cover a few ways you can copy a site page from site to site, using a variety of different tools and products along the way.
#1 Create a flow in Power Automate
In this example we can use Power Automate to allow users to select the page they want to copy, input the site URL they want to copy to and let the flow do its magic!
- Create a new flow in Power Automate > use the instant cloud flow option.
- Create a for a selected file trigger > enter the site address and library name.
NOTE: In my example, just entering ‘Site Pages’ resulting in my flow not appearing in the Site Pages library. This seems to be an issue with the for a selected file trigger. In order to get it to show up, I had to use the library ID instead of the library name. To get the library ID:
- Open the library settings > more library settings
- Copy everything between List=&7B until %7D – this is the library ID
- In the for a selected file trigger > add an input
- Select text as the user input type > update the input name and input value placeholder text. This user input type will be used to allow users to enter the site URL they wish to copy their pages to.
- Add a get file properties action and configure with the following:
- Enter the source site address of your site pages library
- Enter either site pages, or the ID of your site pages library
- Under ID > select ID from the for a selected file trigger
- Add a copy file action and configure with the following:
- Current site address: source site address of your site pages library
- File to copy: Identifier from get file properties
- Destination site address: destination site (or whatever you called your user input) from for a selected file
- Destination folder: /SitePages
- If another file is already there: copy with a new name (optional)
Three steps – that’s it! Now go ahead and test your flow by selecting a site page and copying it to a different site by running your flow.
#2 Use PnP PowerShell
Another way you are able to do this is with PowerShell, in this case I’ll defer to the brilliant SharePoint diary who has a great write up, including all cmdlets you need to copy a page from site to site, or copy all pages. I’ll include the relevant sample for my blog post, but full credit goes to SharePoint diary:
#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
Click here for the full artcle from SharePoint diary.
#3 Use 3rd party migration tools
The final option we have available to us is to utilize 3rd party migration tools to migrate pages between sites. For this example I’ll be using ShareGate, but there are other migration tools that are able to do the same thing:
- Open ShareGate desktop > press copy.
- Select copy content only.
- Enter the URL of your source site > select the Site Pages library.
- Do the same for the destination site.
- Select the page from the source location you wish to copy
- Under options, make the following configuration changes:
- Check preserve authors and time stamps
- Check permissions
- Uncheck user alerts
- Check web parts
- Check version history
- Uncheck flatten folder hierarchy
- Check update links
- Check check in as = published
- Press start copy. Once completed, you should see two successful migration task items for your copied page:
Now you will find your newly copied page in the destination Site Pages library. In my experience of copying pages using ShareGate, images hosted within a CDN will still be present within your page, as will all the of text, layouts and any formatting. Images that are stored within different sites may error, as will document library/ list web parts that point to different sites also.