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

%3CLINGO-SUB%20id%3D%22lingo-sub-1258915%22%20slang%3D%22en-US%22%3ESharePoint%20Online%20-%20Copy%20site%20pages%20between%20site%20collections%20-%20is%20that%20possible%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1258915%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20been%20asked%20to%20move%20some%20site%20pages%20from%20a%20Microsoft%20Team%20to%20another%20Team.%20In%20the%20modern%20look%20of%20SharePoint%20Online%20I%20can%20select%20the%20page%20(example1.aspx)%20and%20when%20clicking%20on%20the%20three%20dots%20I%20am%20given%20the%20option%20%22Copy%20to%22.%20As%20you%20probably%20know%2C%20the%20page%20can%20be%20copied%20only%20on%20the%20same%20site%2FTeam.%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20switch%20to%20the%20%22classic%22%20look%2Fmode%2C%20I%20am%20given%20the%20option%20%22Copy%22%20and%20I%20can%20type%20a%20destination%20document%20library%20or%20folder%20(see%20the%20screenshot%20below)%2C%20but%20when%20I%20try%20to%20copy%20that%20to%20another%20site%2C%20I%20always%20get%20an%20error%20(refuse%20to%20connect).%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22fstorer_0-1585307394746.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F179936iABDE2C8713E289C6%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22fstorer_0-1585307394746.png%22%20alt%3D%22fstorer_0-1585307394746.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20know%20that%20there's%20a%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsharepoint.uservoice.com%2Fforums%2F329214-sites-and-collaboration%2Fsuggestions%2F35035618-add-the-ability-to-copy-a-modern-site-page-from-on%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EUser%20Voice%20page%3C%2FA%3E%26nbsp%3Basking%20specifically%20for%20this%20feature%2C%20but%20I%20would%20like%20to%20know%20if%20there%20is%20some%20workaround%20we%20can%20try%20in%20the%20meantime%2C%20like%20free%20migration%20tools%20or%20some%20scripts%20via%20PowerShell.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance%20for%20your%20help!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrancesco%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1258915%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1259113%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20-%20Copy%20site%20pages%20between%20site%20collections%20-%20is%20that%20possible%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1259113%22%20slang%3D%22en-US%22%3ETake%20a%20look%20at%20this%20old%20thread%3A%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsharepoint%2Fcopy-or-move-site-page-from-one-site-to-another%2Fm-p%2F255703%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsharepoint%2Fcopy-or-move-site-page-from-one-site-to-another%2Fm-p%2F255703%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1259248%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20-%20Copy%20site%20pages%20between%20site%20collections%20-%20is%20that%20possible%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1259248%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3Bfor%20your%20quick%20reply.%3C%2FP%3E%3CP%3EI%20tried%20the%20option%20of%20opening%20the%20document%20library%20in%20Internet%20Explorer%20and%20after%20that%20working%20with%20File%20Explorer%2C%20but%20it%20didn't%20work%2C%20I%20got%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22fstorer_0-1585317744732.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F179970iC628940F216375F9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22fstorer_0-1585317744732.png%22%20alt%3D%22fstorer_0-1585317744732.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20see%20that%26nbsp%3BNiclasDahl%20suggests%20to%26nbsp%3B%3CSPAN%3Eallow%20customization%20on%20the%20the%20destination%20site%2C%20but%20in%20another%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsharepoint-developer%2Fhow-do-i-set-denyaddandcustomizepages-for-sharepoint-2019%2Fm-p%2F303980%22%20target%3D%22_self%22%3Epost%3C%2FA%3E%26nbsp%3BJoel%20Rodrigues%20doesn't%20recommend%20it%20(Hi%2C%20I%20would%20highly%20recommend%20that%20you%20don't%20do%20that.%20That%20feature%20was%20removed%20for%20a%20good%20reason%20as%20it%20causes%20issues%20in%20the%20long%20term).%20Does%20someone%20know%20which%20kind%20of%20issues%20this%20might%20cause%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%20for%20your%20help!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1933101%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20-%20Copy%20site%20pages%20between%20site%20collections%20-%20is%20that%20possible%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1933101%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F429537%22%20target%3D%22_blank%22%3E%40fstorer%3C%2FA%3E%26nbsp%3BHi%2C%20for%20anyone%20looking%20for%20a%20solution%20this%20might%20help%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EImport-Module%20SharePointPnPPowerShellOnline%0A%0A%23Source%20and%20Target%20Sites%0A%24tenant%20%3D%20%22tenant%22%3B%0A%24SourceUrl%3D%22https%3A%2F%2F%24tenant.sharepoint.com%2Fsites%2FsourceSite%22%0A%24targetRelativeLibraryUrl%3D%22%2Fsites%2Fmarketing%2FSitePages%22%0A%0A%23SPO%20Connection%0A%24AdminPassword%3DRead-Host%20-Prompt%20%22Password%22%20-AsSecureString%0A%24adminUPN%20%3D%20%22admin%40australia.com.au%22%0A%24Credentials%20%3D%20New-Object%20-TypeName%20System.Management.Automation.PSCredential%20-ArgumentList%20%24adminUPN%2C%20%24AdminPassword%0AConnect-PnPOnline%20-Url%20%24SourceUrl%20-Credentials%20%24cred%0A%23Connect-PnPOnline%20-Url%20%24SourceUrl%20-UseWebLogin%0A%24ServerRelativeUrl%3D(Get-PnPWeb).ServerRelativeUrl%0A%0A%23Get%20all%20source%20pages%0A%24pages%20%3D%20Get-PnPListItem%20-List%20sitepages%0A%0AForeach(%24page%20in%20%24pages)%7B%0A%20%20%20%20%24pageName%20%3D%20%24page.FieldValues%5B%22FileLeafRef%22%5D%0A%20%20%20%20%23if(%24pageName%20-like%20%22Migrated*%22)%7B%20%23OPTIONAL%20FILTER%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%23Write-Host%20%24pageName%0A%20%20%20%20%20%20%20%20%24file%20%3D%20Get-PnPFile%20-Url%20%22%24ServerRelativeUrl%2FsitePages%2F%24pageName%22%0A%20%20%20%20%20%20%20%20%24fileServerRelativeUrl%20%3D%20Get-PnPProperty%20-ClientObject%20%24file%20-Property%20%22ServerRelativeUrl%22%0A%0A%20%20%20%20%20%20%20%20%23Start%20the%20move%0A%20%20%20%20%20%20%20%20Move-PnPFile%20-ServerRelativeUrl%20%24fileServerRelativeUrl%20-TargetServerRelativeLibrary%20%24targetRelativeLibraryUrl%20-Force%20%20-AllowSchemaMismatch%20-AllowSmallerVersionLimitOnDestination%0A%20%20%20%20%23%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1940044%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20-%20Copy%20site%20pages%20between%20site%20collections%20-%20is%20that%20possible%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1940044%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F658758%22%20target%3D%22_blank%22%3E%40Sheldon-Faria%3C%2FA%3E%26nbsp%3B%20please%20share%20more%20details%20about%20it%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehow%20to%20copy%20.aspx%20page%20to%20another%20site%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2071187%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20-%20Copy%20site%20pages%20between%20site%20collections%20-%20is%20that%20possible%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2071187%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F879960%22%20target%3D%22_blank%22%3E%40pgawde_800%3C%2FA%3E%26nbsp%3B%20I%20solved%20using%20PNP-PoweShell%2C%20afterwards%20I%20only%20had%20to%20upload%20the%20images%20to%20the%20Image%20WebParts.%3C%2FP%3E%3CDIV%3E%3CP%3Etry%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%24srcSiteURL%26nbsp%3B%26nbsp%3B%26nbsp%3B%3D%26nbsp%3B%22%3CA%20href%3D%22https%3A%2F%2Fxxxxx.sharepoint.com%2Fsites%2Fxxxxx%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxxxxx.sharepoint.com%2Fsites%2Fxxxxx%2F%3C%2FA%3E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%24destSiteURL%26nbsp%3B%26nbsp%3B%3D%26nbsp%3B%22%3CA%20href%3D%22https%3A%2F%2Fxxxxx.sharepoint.com%2Fsites%2Fyyyyy%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxxxxx.sharepoint.com%2Fsites%2Fyyyyy%2F%3C%2FA%3E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%24pageName%26nbsp%3B%3D%26nbsp%3B%22test.aspx%22%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BConnect-PnPOnline%26nbsp%3B-Url%26nbsp%3B%24srcSiteURL%26nbsp%3B-Credentials%26nbsp%3BSharepointCredential%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%24tempFile%26nbsp%3B%3D%26nbsp%3B%5BSystem.IO.Path%5D%3A%3AGetTempFileName()%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BExport-PnPClientSidePage%26nbsp%3B-Force%26nbsp%3B-Identity%26nbsp%3B%24pageName%26nbsp%3B-Out%26nbsp%3B%24tempFile%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BConnect-PnPOnline%26nbsp%3B-Url%26nbsp%3B%24destSiteURL%26nbsp%3B-Credentials%26nbsp%3BSharepointCredential%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BApply-PnPProvisioningTemplate%26nbsp%3B-Path%26nbsp%3B%24tempFile%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BWrite-Host%26nbsp%3B%22Success%22%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FP%3E%3CP%3Ecatch%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BWrite-Host%26nbsp%3B-ForegroundColor%26nbsp%3BRed%26nbsp%3B'Error%20'%2C'%3A'%24Error%5B0%5D.ToString()%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%26nbsp%3B%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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). 

fstorer_0-1585307394746.png

I know that there's a User Voice page 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 

6 Replies

Thanks @Juan Carlos González Martín 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:

fstorer_0-1585317744732.png

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!

@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
    #}
}

@Sheldon-Faria  please share more details about it?

 

how to copy .aspx page to another site?

@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();

    } 

@David2Felix 

I have managed to do this, however I am missing the images - what are the steps to get the content from the source page over to the destination page?

 

I can not even see the images in the pages from the source content SharePoint site stored anywhere in document libraries.

 

Thanks for any help!