Forum Discussion

Thao Pham-Aaltonen's avatar
Thao Pham-Aaltonen
Brass Contributor
Sep 19, 2018

Copy or Move Site Page from one site to another

Hello, I've been searching to see if this is possible but it appears with the modern experience, you can only copy a site page to the same Site Pages library in the same site.  If I switch my view to Classic Experience, I can copy a site page to another site if I put in the URL path to the other site's Site Pages library.  Does anyone know if this will be available in the modern experience?  We have to use ShareGate currently to copy modern pages from one site to another but we would like to have the ability to do this in the SharePoint UI.   Thanks, Thao

  • NiclasDahl's avatar
    NiclasDahl
    Brass Contributor

    Thao Pham-Aaltonen I've been struggling with this as well and managed to create a workaround with Flow where you create a copy of the page in the new site collection.

     

     

    Set up the flow as below and then trigger it by checking out and checking the sites.

     

    It has a few drawbacks though:

    1. All the pages assets are sourced to the old sites assets library, I haven't found a way to move them without having to relink every single news item. I tried the move action, but in the SP UI you cannot select the site assets library as a target destination. So you cannot delete the old site because the all assets link will be broken on the pages.

     

    2. The one owning the flow will be the creator of all the news created in this manner.

     

    3. Creation date will be changed to the current time, which will screw up the ordering of news for example. But if you don't have a massive amount news pages to move you can keep the chronological order of them if you check out each site separately, starting with the oldest. And then you can just bulk move the rest.

    • BrenG's avatar
      BrenG
      Copper Contributor

      NiclasDahl 

      Thanks! This worked great on one of our sites.  However, On our main site it did not work.  I have Full Control and Admin permissions. I get an access denied error.  Do you know if there is anything specific that might be causing this error.  Is there anything I need to enable in Admin or Site Settings?  

       

      Thanks,

      Bren

      • NiclasDahl's avatar
        NiclasDahl
        Brass Contributor

        BrenG 

         

        It could be that you have to allow customization on the the destination site, you can turn that on with powershell:

         

        Connect-SPOService -Url "https://YOURDOMAIN-admin.sharepoint.com" -Credential $userCredential

        set-sposite "https://YOURDOMAIN.sharepoint.com/sites/SITENAME" -denyaddandcustomizepages $false

         

        If that doesn't work there is another way to move the sites and other resources, but it only works if you use Internet Explorer and it requires page customization to be allowed.

        This is what you do:

        1. open IE and navigate to the site where you have the pages/resources you want to move

        2. go the the/a document library

        3. click on the view options and pick "view in file explorer" (this is only available in the doc libraries, not list or general site content)

        4. This will will open the document folder in your local explorer and then you can browse back to the sitepages folder and copy the content there.

        5. Repeat 1-4 on the destination site, but instead of copying you paste the pages/resources there. This works for all the site content (list, assets, lirbraries etc.etc.)

         

        The problem with pages sourcing their images and other content to the old site will still persist though....

  • You are correct, the copy option in the Site Pages library does not allow to copy the page to a different site. I have cheched the Office 365 roadmap, but there is not a new feature under development to cover this requirement
  • Thoroughly realise that this a rant but....

     

    Why in all that is sensible and logical is this so difficult?! I get and accept the whole challenge of updating where resources live.... its web and HTML. If you don't update the hyperlink its going to point to the original source. Do I think its possible to automate the update - hell yeah - especially given that 3rd party products seem to be able to do it. Right now I would settle for the ability to simply copy and paste the raw web files and associated documents.... why oh why can I download one page but not a whole site's worth?!

    We shouldn't have to build work arounds in other products to do something simple like file copying! Its  things like this that make people run Linux!

  • pdestefanis's avatar
    pdestefanis
    Iron Contributor

    Four years on and this issue remains. I can't blame users when they get frustrated at SharePoint for lacking the most basic features...

    It looks like this feature will never be implemented and we are just telling that to our users. It really sucks. 

    Thao Pham-Aaltonen 

    • mattchowell's avatar
      mattchowell
      Iron Contributor
      As I mentioned above, it's easy enough to copy pages to other sites using SP Designer, but it's pretty shocking Msft hasn't added a ui option to do this.
  • aowen42's avatar
    aowen42
    Copper Contributor

    Thao Pham-AaltonenCannot believe this function isn't available, its cost me half a days work  so far, and now I'll have to recreate the page from scratch. This is.... SOO Frustrating...

     

    I've tried all the suggestions, none have worked...

     

    Just wanted to write, stage, test, then publish to a wider community!

     

    <grr>

    • mattchowell's avatar
      mattchowell
      Iron Contributor

      aowen42 It is absurd that this isn't available in the ui. The easiest workaround I've found is to open both sites in SP Designer (custom scripting must be enabled), copy the page and paste it in the target site site pages library. It retains all the original links, image references etc though so you may want to edit a few things once moved - and double check permissions as it appears to inherit the target site's library permissions. 

      This is so easy to do but why Msft hasn't made this a ui option is beyond me.

      • rschreib's avatar
        rschreib
        Copper Contributor

        mattchowell Thank you! That was a great suggestion.  I really did not want to recreate the page and the Move to is not available.

    • André Maas's avatar
      André Maas
      Brass Contributor

      sthieu Question: How do you switch to an other sitecollection in the Sitemanager when clicked Copy to?

    • André Maas's avatar
      André Maas
      Brass Contributor
      How to switch to another sitecollection in sitemanager when select a page and clicked copy to
      • sthieu's avatar
        sthieu
        Copper Contributor
        sorry Andre, I was mistaken, it was only to another sub web. You will have to use one of the other options in the thread
  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    Hi Thao Pham-Aaltonen,

    you can also use "PnP Powershell" and a provisioning template to copy site pages to different site collections 

    First install PnP Powershell and the execute this script

    Connect-PnPOnline https://yourtenant.sharepoint.com/sites/mysite -Interactive
    
    Get-PnPSiteTemplate -Out ".\pages.xml" -Handlers PageContents -Includeallclientsidepages

    This will give you an XML file containing all the client side pages of that site. Now you can edit that file and remove the pages you don't want to transfer. Then connect to the target site and apply the template

    Connect-PnPOnline https://mytenant.sharepoint.com/sites/othersite -Interactive
    
    Invoke-PnPSiteTemplate ".\pages.xml"


    A little bit overdone if you just want to transfer a single page but works really well if you want to transfer multiple pages.

    Although this is also an external tool like Sharegate it is at least free.

    Best Regards,
    Sven


  • aowen42's avatar
    aowen42
    Copper Contributor
    I can't even get it to work in Classic, just says destination doesn't exist... And I'm owner of both sites... And it sounds as if, even if you can do it, you'd need to recreate/repoint the images/assets within the page...
  • henriqueserafim's avatar
    henriqueserafim
    Copper Contributor

    Thao Pham-Aaltonen I know this thread is a bit old and still people struggle finding a easy way to do a simple task. Maybe you can try an extension developed by Torpedo that allows you to do that task in SharePoint Online with a few clicks. It has a 3 day trial for you to do the job. Copy Page to Site 

    • deanshepherd's avatar
      deanshepherd
      Brass Contributor
      I have allways used this simple powershell to move\copy pages between sites. Wish the copy to button would allow you to move pages across sites that you are an owner of simalar to documents ... sey lah vee, maybe next year

      #Parameters, set the source site, set the destination site set the page name
      $SourceSiteURL = "https://tenant.sharepoint.com/sites/mysourcesite"
      $DestinationSiteURL = "https://tenant.sharepoint.com/sites/mydestinationsite"
      $PageName = "mypage.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
      • henriqueserafim's avatar
        henriqueserafim
        Copper Contributor
        That is another approach yes and it does the job. The idea of this extension is to allow a worries free about having to change/adapt the code for different tenants, pages, sites,webs. You can do it using powershell, power automate, old/legacy sharepoint features or using the extension. Just another option to be added with pros and cons obviously. But nice and cute little piece of code you have there 😉

Resources