How to update Confluence shortcut links when a base URL has changed
プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。
問題
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?
原因
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.
データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。
- 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%';
Restart Confluence or flush the cache in General Configuration → Cache Management to have these changes be reflected in the UI.