It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bulk Change of Links in Confluence

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

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

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

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.

@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

@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? 

@Kihom At Did you restart your Confluence instance?

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.

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".

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What project did you transition or start on Confluence with the shift to remote work?

It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...

109 views 3 7
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you