How do I manually change the base URL
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When having issues with following the UI Configuring the Server Base URL, you receive the following error in the UI
"Your session has expired. You may need to re-submit the form or reload the page."
Solution
Manual manipulation of the database can be dangerous. Please make sure you have a backup of your database before you attempt these changes.
Retrieve the base URL from the bandana table:
1
2
3
4
select BANDANAVALUE
from BANDANA
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';
This will give you output of a large string in the bandanavalue field. You can copy out the entire value and update the baseUrl, then insert the entire value back in. The entire value for this record is surrounded by <settings></settings> tags, copy everything including those tags to a text editor to make the necessary changes.
Postgres query
1
2
3
4
update BANDANA
set BANDANAVALUE = "<string_from_above_step>"
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';
SQL Server query
1
2
3
4
update BANDANA
set BANDANAVALUE = '<string_from_above_step>'
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';
⚠️ Notice the use of single quotes, instead of double quotes when modifying the BANDANAVALUE. If you use double quotes and the QUOTED_IDENTIFIER parameter is set to ON in your MS SQL Server database, you may hit the following error message:
1
SQL Error [103] [S0004]: The identifier that starts with '<settings> <doNotSave>false</doNotSave> <allowCamelCase>false</allowCamelCase> <allowTrackbacks>false</allowTrackbacks>..... ' is too long. Maximum length is 128.
Alternatively, if you're certain your baseUrl value is not anywhere else in the output, one can use the replace function to make the job a lot faster:
Postgres query
1
2
3
4
update BANDANA
set BANDANAVALUE = replace(BANDANAVALUE, '<old baseUrl>', '<new baseUrl>')
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';
SQL Server query
1
2
3
4
UPDATE BANDANA
SET BANDANAVALUE = CAST(REPLACE(CAST(BANDANAVALUE as nvarchar(max)),'<oldURL>','<newURL>') as ntext)
WHERE BANDANACONTEXT = '_GLOBAL'
AND BANDANAKEY = 'atlassian.confluence.settings';
Was this helpful?