How do I manually change the base URL
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:
select BANDANAVALUE
from BANDANA
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';
update BANDANA
set BANDANAVALUE = "<string_from_above_step>"
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';
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:
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:
update BANDANA
set BANDANAVALUE = replace(BANDANAVALUE, '<old baseUrl>', '<new baseUrl>')
where BANDANACONTEXT = '_GLOBAL'
and BANDANAKEY = 'atlassian.confluence.settings';
UPDATE BANDANA
SET BANDANAVALUE = CAST(REPLACE(CAST(BANDANAVALUE as nvarchar(max)),'<oldURL>','<newURL>') as ntext)
WHERE BANDANACONTEXT = '_GLOBAL'
AND BANDANAKEY = 'atlassian.confluence.settings';