Programmatically changing Server Base URL

Bob Kaucher April 5, 2016

Is there a way to change the server base URL from either SQL or via a configuration file?

I'm working on automating the testing of our disaster recovery and this is the only aspect that I have left requiring human intervention. If there is an option for doing this, it would make my life a lot easier. I've searched the DB schema for anything with server, base, and url in it but have not found anything.

3 answers

1 accepted

1 vote
Answer accepted
Bob Kaucher April 5, 2016

Thanks, Nic. My question was actually about Confluence. I should have said so explicitly even though I tagged it as such. But your answer got me to thinking, if it's not in someplace obvious as in Jira, then it's got to be someplace that is not obvious. It is in fact in the BANDANA table and stored within a string column that contains XML. Add that info to your answer and I'll accept it. Please leave the info about JIRA as well because people coming hear from Google might be looking for that as well.

SELECT [BANDANAID]
,[BANDANACONTEXT]
,[BANDANAKEY]
,[BANDANAVALUE]
FROM [Confluence].[dbo].[BANDANA]
WHERE [BANDANAVALUE] LIKE '%domain.com%'
SELECT * FROM [Jira].[dbo].[propertyentry] as [e]
INNER JOIN [Jira].[dbo].[propertystring] as [s] on [s].[ID] = [e].[ID ]
WHERE [s].[propertyvalue] like '%domain.com%'
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2016

Sorry, had JIRA on the brain.  Yes, Bandana for Confluence (same advice for doing it while Confluence is offline though)

Bob Kaucher April 5, 2016

I intended that as a comment... Apparently computers are too hard for me.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2016

Not you, me.  I converted it to an answer because it was a metric-shed-load more right than mine and deserved the "right" flag!  Glad the hint got you headed in the right direction despite being completely wrong, I'm very impressed by that leap!

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2016

With SQL (while JIRA is down), and from memory, the base url is in one of the first 40-50 records in "propertyentry" and you can just splat a new one in there.

0 votes
Daniel Eads _unmonitored account_
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.
May 9, 2016

For people coming in to actually replace these (instead of just looking at them)

JIRA - replace the whole property (specify the new url, including http/https)

UPDATE propertystring SET propertyvalue = 'https://NEW.URL.com' WHERE id in (select id from propertyentry where property_key like '%baseurl%');

Confluence - replace just the slice (the field is a CLOB) that contains the host portion. You don't need to specify http/https here as the SQL will only replace the portion of the URL that you enter. Just specify your old URL and new URL.

update BANDANA
set BANDANAVALUE = replace(BANDANAVALUE, 'OLD.URL.com', 'NEW.URL.com')
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events