How to update Confluence shortcut links when a base URL has changed

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

We have recently made an update to our Confluence base URL. We have several shortcut links configured in the system and would like to update them as they still show the old base URL from the Confluence UI. How can I update these links en masse so that they will continue to function with our new URL?

Cause

The shortcut links are configured in the UI and stored in the database but do not get updated when the base URL changes, especially if the base URL update was a part of an upgrade or migration.

The base URL can be updated in the configured shortcut links via a direct database update. 

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  1. Run the following SQL query to find the shortcut link bandana mappings in the database:
SELECT * 
FROM bandana
WHERE bandanakey LIKE '%atlassian.confluence.shortcut.links%'

2. Here, we are simply updating the bandanavalue column, looking for the old link value and replacing it with the new one. Using the bandanaid from step 1 and replacing the needed parameters for your instance, run the following query to update the old value to the new value:

UPDATE bandana
SET bandanavalue =
replace(bandanavalue,
'Old-Confluence-Base-URL', 'New-Confluence-Base-URL')
WHERE bandanaid = 'BANDANAID-HERE'

3. Finally, the following statement updates the table dedicated for sidebar links:

UPDATE AO_187CCC_SIDEBAR_LINK
SET HARDCODED_URL =
REPLACE(hardcoded_url, 'Old-Confluence-Base-URL', 'New-Confluence-Base-URL')
WHERE hardcoded_url LIKE '%Old-Confluence-Base-URL%';
  • (info) Restart Confluence or flush the cache in General Configuration → Cache Management to have these changes be reflected in the UI.


Last modified on Aug 18, 2020

Was this helpful?

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