How to solve broken links after migrating to another server Edited

I migrated Confluence (V. 6.4.3) to another server yesterday. Now I found a bug with the links within the page and a workaround which is not suitable for each site.

After migrating to the new server on the first view everything looked fine. But as soon as I started to edit an already existing page all the links on this page link to the page itself after releasing the page. (Even if I don't make any changes and just save the content after pressing the edit button the links on the page and all the links to the data which is attached to this page are broken.)

I figured out that I can fix this behaviour by doing the following steps:

1. Edit the page (don't do any change but just save the page to produce a new version)

2. Go to the version history and reproduce the prior version (before migration) Now the links somehow get repaired and it is possible to edit the page again without damaging the links.

But there must be an other option to fix this issue. I can't open every single page created within Confluence to save it and restore the prior version of it. This will take months. Please tell me how to fix this bug on the whole confluence instance.

The funny thing is that links that contain special characters like "&" or non-english special characters like "ö" work fine and are not affected by this issue.

Thank you very much in advance

4 answers

1 vote
Adam Barnes Atlassian Team Dec 11, 2017

Hi @Stefan Wolff, the Bug report is the best place to share your comments and vote as well as watch for a workaround. This helps all information be captured in one place. This issue is high on our priority list and I anticipate that it will be resolved in the near future. 

0 vote
Ann Worley Atlassian Team Dec 05, 2017

Please let me know:

  • What steps were taken to move the Confluence instance to the new server.
  • Was the base URL changed? 
  • If you create a new page with links and edit it, do the links break in the same way?

Please edit a page, save it so the links are broken, then paste the storage format into a code block on this thread. The storage format can be copied from the page tools menu>View Storage format. This will allow me to examine the links more closely rather than asking you to describe what you see.

Ann Worley Atlassian Team Dec 05, 2017

I take it back - we don't have to gather so much information because it is a known issue: Links are changed to a self referential link of the page once you edit the page

I hope you will vote and comment to emphasize the inconvenience of this. That will automatically add you as a watcher so you can get updates on progress.

Thanks for the information. This shows at least Atlassian did't fix this bug since months. It doesn't really help me to get rid of the problem and I would rather read an answer like "we just fixed it - install the bugfix".

So please tell your coders to fix this issues asap. Thanks a lot in advance.

"What steps were taken to move the Confluence instance to the new server."

1. Backup of the complete "Application Data" Folder with subfolders. SQL-Backup of the Database. Shutdown of Services and Database

2. Install Confluence on new Server. Restore Application Data and SQL-DB-Restore

3. Start Confluence

"Was the base URL changed? "

Yes.

"If you create a new page with links and edit it, do the links break in the same way?"

No, it just happens to links that were existing before the migration already.  And it only happens to internal links (other pages within Confluence and attached files). External links (e.g. atlassian.com or google.com still work fine and are not broken) And like I told you in my post from last week - I found a way to repair those broken links by using the version history. 

Would there be a possibility to alter data in the SQL-DB to get the links fixed again in one rush?

 

I also checked how Confluence creates the links in HTML:

Working link before it's broken:

<p class="auto-cursor-target">&rarr; <ac:link><ri:page ri:content-title="Name_of_the_Page" /></ac:link></p>

After migration the link looks like this:
<p class="auto-cursor-target">&rarr; <ac:link /></p>

Hi,

we have also this issue...
We just changed the URL. The server was not migrated.

Is this issue already on a roadmap? Will it be fixed? Is there a workaround?

We also upgraded to the newest Confluence version but the issue still persists.

BR

Sorry, have not followed the ticket link. My bad.

This issue still persists in Confluence 6.7.2.

Hi again,

after upgrading we had to deactivate and reactivate Colaborative editing and restart indexing.

Now the old pages can be edited without loosing links.

BR

Joe Xie Atlassian Team Mar 14, 2018

@Andreas Wachter, what is the issue in 6.7.2 that you see?

After upgrading to 6.7.2, and then changed the base url, editing a draft that has unpublished content from pre-baseurl-change should no longer break that link. Existing drafts or pages that has had the issue from a prior version will remain as is though (as the information about the link has already been lost).

As for turning off collaborative editing, that will have the side effect of dropping unpublished draft content (may be undesirable), and if the draft has already been autosaved, this will not fix the issue. Re-indexing should not be required (as indexing is a separate subsystem to collaborative editing). 

@Joe Xie, I'm sorry if my previous post was not clear. There is no issue any more.

First we had Confluence 6.5.1, then we changed the URL which caused the problem as described and upgraded to 6.7.2.

After this upgrade to 6.7.2 the issue was still here. All pages that was created before URL change in Version 6.5.1 lost their old links after saving.

After searching a bit longer for this issue I found this procedure with de-/reactivating Colaborative editing and restart indexing. After doing this, new pageupdates on old pages didn't destroyed old links anymore.

The already destroyed links can be recovered manually by comparing the current pageversion with previous pages versions.

 

We also created a database query to find all affected pages. This query shows also some not affected pages, but it makes life easier by finding pages out of hundreds.

SELECT s.SPACENAME,c.TITLE, ROUND (   
        (
            LENGTH(b.BODY)
            - LENGTH( REPLACE ( b.BODY, "<ac:link />", "") )
        ) / LENGTH("<ac:link />")        
    ) AS count FROM confluencedb.SPACES s INNER JOIN confluencedb.CONTENT c on s.SPACEID=c.SPACEID JOIN confluencedb.BODYCONTENT b ON c.CONTENTID=b.CONTENTID WHERE PREVVER is NULL AND b.BODY like '%<ac:link />%'
    ORDER BY s.SPACENAME;

 

@Joe Xie, I'm sorry if my previous post was not clear. There is no issue any more

First we had Confluence 6.5.1, then we changed the URL which caused the problem as described and upgraded to 6.7.2.

After this upgrade to 6.7.2 the issue was still here. All pages that was created before URL change in Version 6.5.1 lost their old links after saving.

After searching a bit longer for this issue I found this procedure with de-/reactivating Colaborative editing and restart indexing. After doing this, new pageupdates on old pages didn't destroyed old links anymore.

The already destroyed links can be recovered manually by comparing the current pageversion with previous pages versions.



We also created a database query to find all affected pages. This query shows also some not affected pages, but it makes life easier by finding pages out of hundreds.

SELECT s.SPACENAME,c.TITLE, ROUND (   
        (
            LENGTH(b.BODY)
            - LENGTH( REPLACE ( b.BODY, "<ac:link />", "") )
        ) / LENGTH("<ac:link />")        
    ) AS count FROM confluencedb.SPACES s INNER JOIN confluencedb.CONTENT c on s.SPACEID=c.SPACEID JOIN confluencedb.BODYCONTENT b ON c.CONTENTID=b.CONTENTID WHERE PREVVER is NULL AND b.BODY like '%<ac:link />%'
    ORDER BY s.SPACENAME;

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted 3 hours ago in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

25 views 0 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you