Change 50,000+ rows of hardcoded links

My Confluence instance has 50,000+ rows of hardcoded links. Is it possible to change them with an update script (SQL Server 2008) using __ATLASSIAN_BASE_URL__? For example

UPDATE

LINKS

SET DESTPAGETITLE =REPLACE(DESTPAGETITLE,'//hstnwikiweb','__ATLASSIAN_BASE_URL__'

)

WHERE

DESTPAGETITLE

LIKE

'%//hstnwikiweb%'

UPDATE

BODYCONTENTSET BODY =CAST(REPLACE(CAST(BODY ASvarchar(MAX)),'//hstnwikiweb','__ATLASSIAN_BASE_URL__')AStext)

WHERE

BODY

LIKE'%//hstnwikiweb%'

1 answer

Hi Derek,

I'm not sure whether the SQL would work for you or not, but you could certainly take a backup and give it a try. However, when I read the title of your question my first thought was that you should export your data to XML, open it in a text editor and use the Find+Replace function to replace the URLs and then re-import the data. So, in the event that the SQL doesn't work then try editing the XML and see whether that works for you.

All the best,
John

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 Friday in Off-topic

Friday Fun: Riddle me this

Happy Friday, Funmakers! We had a Community Team offsite in Austin this week, and my mind feels primed for thinkin' from all the brainstorming we did!  So, this week's Friday Fun thread w...

144 views 19 3
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