How do I manually change the base URL

Still need help?

The Atlassian Community is here for you.

Ask the community

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';
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.
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';





Last modified on Mar 21, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.