Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-54759

Absolute Cloud URLs are not usable in Server when migrating with simple domain name replacement

    XMLWordPrintable

Details

    Description

      Summary

      When migrating from Confluence Cloud to Confluence Server, if there are absolute URLs used in page links these are no usable in Confluence Server.

      Usually we follow

      to change the domain name, however the URLs are now completely different and there is no 1-to-1 mapping.

      Steps to Reproduce

      1. Set up a Confluence Cloud environment
      2. Create 2 pages, PageA and PageB with some dummy content
      3. Edit PageA, highlight some text and press Ctrl+K
      4. Choose Web Link and for Address, use the full URL for PageB
      5. Edit PageB, highlight some text and press Ctrl+K
      6. Choose Web Link and for Address, use the full URL for PageA
      7. Go to Backup Manager wiki/plugins/servlet/ondemandbackupmanager/admin and click Create Backup
      8. Download Site_Backup.zip
      9. Follow the steps in How Do I replace all 'hard' links to my old Base URL (note, this KB has been updated to reflect this bug) to change all the domain names from mycompany.atlassian.net to confluence.mycompany.com
      10. Set up Confluence 6.6.1 and on the page Load Content select Restore From Backup
      11. Choose the file Site_Backup.zip and proceed to set up Confluence as usual

      Remember to start Confluence with

      Expected Results

      The URLs for the links between pages work as expected.

      Actual Results

      Confluence Cloud links are not 1-to-1 mappable to Confluence Server.

      Notes

      URLs in Confluence Cloud have the format of

      Whereas the similar link in Confluence Server would be either

      Workaround

      The contentid is in the Cloud Confluence URL, so that can be used to map to a Confluence Server URL with /pages/viewpage.action?pageId=

      For example, a regex to match all URLs would be

      mycompany.atlassian.net/wiki/spaces/[A-Z0-9]+/pages/([0-9]+)/[A-Za-z0-9+.]+
      

      and replace with (depending on regex engine)

      confluence.mycompany.com/pages/viewpage.action?pageId=\1
      

      For example if you have

      Cloud URL mycompany.atlassian.com
      Server URL confluence.mycompany.com

      You can use this sed script on entities.xml from the export

      sed -r -e 's/mycompany\.atlassian\.net\/wiki\/spaces\/[A-Z0-9]+\/pages\/([0-9]+)\/[A-Za-z0-9+.]+/confluence.mycompany.com\/pages\/viewpage.action?pageId=\1/g' entities.xml
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrichards@atlassian.com James Richards
              Votes:
              15 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated: