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

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,345 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot