Forum Discussion

fstorer's avatar
fstorer
Brass Contributor
Mar 27, 2020

SharePoint Online - Copy site pages between site collections - is that possible?

Hello everyone,

 

I have been asked to move some site pages from a Microsoft Team to another Team. In the modern look of SharePoint Online I can select the page (example1.aspx) and when clicking on the three dots I am given the option "Copy to". As you probably know, the page can be copied only on the same site/Team. 

When I switch to the "classic" look/mode, I am given the option "Copy" and I can type a destination document library or folder (see the screenshot below), but when I try to copy that to another site, I always get an error (refuse to connect). 

I know that there's a https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/35035618-add-the-ability-to-copy-a-modern-site-page-from-on asking specifically for this feature, but I would like to know if there is some workaround we can try in the meantime, like free migration tools or some scripts via PowerShell. 

 

Thank you in advance for your help!

 

Francesco 

8 Replies

  • For anyone landing on this thread looking for an active workaround now that Microsoft has systematically deprecated the classic publishing and UI mode overrides: Bypassing the modern SharePoint cross-site collection page isolation block natively presents severe infrastructure and workflow bottlenecks. The standard Modern "Copy to" command remains hard-locked at the file system level to enforce site boundaries, and attempting to build complex Power Automate flows frequently drops custom web part property bags, strips advanced JSON schemas, or leaves image paths broken and pointing back to the original source.

     

    A secure, browser-based workaround is to deploy a localized client-side utility (.sppkg) directly into your secure Tenant App Catalog. This injects a clean, automated button directly into your native Site Pages library command bar, acting as an in-tenant replication engine.

     

    By selecting your template pages, pasting the target site collection URL, and executing, the solution serializes and clones complex layouts, multi-column grids, and web part properties in 3 seconds flat. Because it enforces 100% in-tenant isolation with zero external API calls or public CDN tracking loops, it clears strict Infosec vetting in minutes.

     

    If your team is seeking a verified installation walk-through and wants to view the live canvas behavior, you can step through the parameters on the SharePoint Online Cross-Site Page Copier Engine Hub: 

    https://sharepointpackages.com/demos/copy-sharepoint-page-to-another-site-collection-demo.html

     

  • Sheldon-Faria's avatar
    Sheldon-Faria
    Copper Contributor

    fstorer Hi, for anyone looking for a solution this might help:

    Import-Module SharePointPnPPowerShellOnline
    
    #Source and Target Sites
    $tenant = "tenant";
    $SourceUrl="https://$tenant.sharepoint.com/sites/sourceSite"
    $targetRelativeLibraryUrl="/sites/marketing/SitePages"
    
    #SPO Connection
    $AdminPassword=Read-Host -Prompt "Password" -AsSecureString
    $adminUPN = "admin@australia.com.au"
    $Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $adminUPN, $AdminPassword
    Connect-PnPOnline -Url $SourceUrl -Credentials $cred
    #Connect-PnPOnline -Url $SourceUrl -UseWebLogin
    $ServerRelativeUrl=(Get-PnPWeb).ServerRelativeUrl
    
    #Get all source pages
    $pages = Get-PnPListItem -List sitepages
    
    Foreach($page in $pages){
        $pageName = $page.FieldValues["FileLeafRef"]
        #if($pageName -like "Migrated*"){ #OPTIONAL FILTER
            
            #Write-Host $pageName
            $file = Get-PnPFile -Url "$ServerRelativeUrl/sitePages/$pageName"
            $fileServerRelativeUrl = Get-PnPProperty -ClientObject $file -Property "ServerRelativeUrl"
    
            #Start the move
            Move-PnPFile -ServerRelativeUrl $fileServerRelativeUrl -TargetServerRelativeLibrary $targetRelativeLibraryUrl -Force  -AllowSchemaMismatch -AllowSmallerVersionLimitOnDestination
        #}
    }
    • JORGE_CORREA_MUOZ's avatar
      JORGE_CORREA_MUOZ
      Copper Contributor
      Thanks a lot, Do you can tell me, how I can create a log file for this process?
      • David2Felix's avatar
        David2Felix
        Copper Contributor

        pgawde_800  I solved using PNP-PoweShell, afterwards I only had to upload the images to the Image WebParts.

        try{

            $srcSiteURL   = "https://xxxxx.sharepoint.com/sites/xxxxx/"

            $destSiteURL  = "https://xxxxx.sharepoint.com/sites/yyyyy/"

            $pageName = "test.aspx"

            

            Connect-PnPOnline -Url $srcSiteURL -Credentials SharepointCredential

            $tempFile = [System.IO.Path]::GetTempFileName();

            Export-PnPClientSidePage -Force -Identity $pageName -Out $tempFile

            

            Connect-PnPOnline -Url $destSiteURL -Credentials SharepointCredential

            Apply-PnPProvisioningTemplate -Path $tempFile

            Write-Host "Success"

            }

        catch{

            Write-Host -ForegroundColor Red 'Error ',':'$Error[0].ToString();

            } 

    • fstorer's avatar
      fstorer
      Brass Contributor

      Thanks jcgonzalezmartin for your quick reply.

      I tried the option of opening the document library in Internet Explorer and after that working with File Explorer, but it didn't work, I got the following error:

      I see that NiclasDahl suggests to allow customization on the the destination site, but in another post Joel Rodrigues doesn't recommend it (Hi, I would highly recommend that you don't do that. That feature was removed for a good reason as it causes issues in the long term). Does someone know which kind of issues this might cause?

       

      Thanks for your help!