Migrate Confluence short links

I have migrated our OnDemand Jira/Confluence to Download instances. One problem area is that some users have pasted short links to Confluencece pages in the description field of many issues.

Is there a way to have those confluence page links updated to point to our new instance? If so what is the best method to accomplish this?

1 answer

1 accepted

Accepted Answer
0 votes

After working with support on this for over a week, host WebEx session and sending them a copy of my Jira & Confluence backups, support finally stated.

"The issue you're running into is expected, though not desired. The logic behind the jira issues macros not changing is that Confluence cannot be sure that when you're migrating to another instance that you indeed want the macros changed. They are stored (as you saw in the storage format) to point to your jira instance. Even when you change the applink to point to a new jira instance url, only new jira issues going forward will be changed. It is designed this way intentionally. The decision behind this logic is that Confluence devs stay away from changing anything in the body content of pages as a rule."

I had our DBA run the following. In the example below I replaced our instance/server name with "server1". After which links in both applications worked fine. Of course you must setup Jira and Confluence as trusted application first, I assume that was a given.

I hope this helps others.

use Confluence
go

begin tran
update BODYCONTENT
set BODY = CAST(REPLACE(CAST(BODY as NVarchar(MAX)),'>JIRA (server1.atlassian.net)<','>JIRA<') AS NText)
where patindex('%JIRA (server1.atlassian.net)%',BODY) <> 0

update BODYCONTENT
set BODY = CAST(REPLACE(CAST(BODY as NVarchar(MAX)),'6785bb03-31b0-34b6-b16a-b8700c844424','8034b128-063e-3308-8ac5') AS NText)
where patindex('%6785bb03-31b0-34b6-b16a%',BODY) <> 0
commit tran
go

use jira
go

begin tran
update remotelink
set URL = CAST(REPLACE(CAST(url as NVarchar(MAX)),'server1.atlassian.net/wiki','productmanagement.server1.com:8443') AS NText)
where patindex('%server1.atlassian.net/wiki%',URL) <> 0

update jiraissue
set description = CAST(REPLACE(CAST(description as NVarchar(MAX)),'server1.atlassian.net/wiki','productmanagement.server1.com:8443') AS NText)
where patindex('%server1.atlassian.net/wiki%',description) <> 0

update jiraaction
set actionbody = CAST(REPLACE(CAST(actionbody as NVarchar(MAX)),'server1.atlassian.net/wiki','productmanagement.server1.com:8443') AS NText)
where patindex('%server1.atlassian.net/wiki%',actionbody) <> 0
commit tran
go

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26,247 views 2 7
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