How to Change URLs of External Gadgets
When you create External Gadgets in Confluence, there is no option to edit the existing gadget's URL, if needed. This might be extremely painful if you're using it across many pages.
And I need to change it to:
Create a database backup before changing anything!
Additionally, any database modifications should be done while Confluence is shut down and not running.
Since changing the gadget's URL is not possible via Confluence interface, you will need to modify the URLs in the database.
Run a SQL statement to update the body content. An example is shown below:
You may need to adjust the SQL statement to work with your specific database type.
update BODYCONTENT set body = replace(body, 'test.com:8080', 'newtest.com/jira') where body like '%test.com:8080%'; -- For Microsoft SQLServer use the following query: UPDATE BODYCONTENT SET body=REPLACE(cast(body as nvarchar(max)),'test.com:8080','newtest.com/jira') where body like '%test.com:8080%';
- Restart Confluence.
- After all the occurrences of gadgets are updated by the SQL above, add the new base URL to the "External Gadgets" section in Confluence Admin.
- In case the application does not recognise the new links for the gadgets (pointing to previous URL still), go ahead and re-index your instance since these URLs may be cached somewhere.