Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bulk Change of Links in Confluence

Glenn Mason March 19, 2013

We are heavy users of Confluence and Jira.

In Confluence we have links to many Jira issues and with our recent move from Hosted Jira to OnDemand Jira all those Jira issues links in Confluence are now broken.

The urls have changed from https://blah.onjira.com/ to https://blah.atlassian.net/ so should be reasonably easy to do a replace if such a facility or process exists.

Our Confluence version is 4.1.

Any help is muchly appreciated.

3 answers

1 accepted

7 votes
Answer accepted
RianA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2013

Hi Glenn,

If the name of your JIRA instance is still similar, you could just reestablish the application link to your JIRA. However it seems that you're using OnDemand version, which is unable to establish application link to outside instance due to its restricted function.

Perhaps you could use the following SQL. Please bear in mind this would work with MySQL and backup your database for safety purpose.

UPDATE BODYCONTENT 
	SET BODY = replace(BODY,'https://blah.onjira.com/','https://blah.atlassian.net/') 
	WHERE BODY LIKE '%https://blah.onjira.com%';

Hope it helps

Kristin Lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2019

Is there a way to run this for URLs listed in the description of JIRA issues where the URL has changed?

Kavirajacholan Selvaraj June 18, 2019

Hi @Kristin Lyons DO you face any issues updating the Update command? I am actually updating the BODYCONTENT Table, But it looks like BodyCOntent Table is crashed post update.

 

I have used exactly like this apart from Where statement, I used ContentID instead of Body.

 

Please help me, Since we are moving live this Friday.

Kristin Lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2019

@Kavirajacholan Selvaraj the script worked for us to fix the links in Confluence with a Postgres DB but we were unable to find a way to fix the links in JIRA's comments or descriptions

Kihom At September 5, 2019

@RianA 

I ran the query you provided us with on my PSQL database.

I do see the lines being updated in the DB (I did a commit ) but they do not appear on the web pages even after several refresh (and cache cleaning). Do we have to do some more steps so that updates in db are taken into account?  Maybe some cache on server side? 

Kristin Lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 6, 2019

@Kihom At Did you restart your Confluence instance?

1 vote
Andrew_McCollum April 10, 2020

I need to jump on this. We have a Dev Environment and a Prod Environment that we migrate Dev pages into. We need a way to find all links automatically that say "Https://mysite/studiodev" and change it to "Https://mysite/studio".

0 votes
Forest F. White February 24, 2017

So, I have about 10k links of varying macros and types. Of course, doing this by hand is something appropriate to 1982's wordstar editor, which didn't have a "find and replace" command. That we cannot do this is a definite time-sink.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events