Convert native HTML macros to HTML-bobswift macros

Convert native HTML macros to HTML-bobswift macros

This article is intended for users who have native HTML macros (html, html-include) on their pages and want to migrate or convert to the HTML-bobswift macro of HTML for Confluence cloud.

If you intend to migrate from your server instance to HTML for Confluence cloud, follow the pre-migration requisites mentioned in this guide. If the pages fail to render your content after migration, try executing the queries mentioned in the next section to resolve the issues.

Or, if you are using the native HTML macros in server and are considering using the HTML-bobswift macro in cloud, you must execute the queries below for a seamless transition.

Instructions

Use these queries to convert the native HTML macros to HTML-bobswift macros. To do so, you need to:

  1. Find all pages that have the native HTML macros on them.

  2. Update each instance of the native macro with HTML-bobswift.

Convert html to html-bobswift

Execute the following queries:

-- This is to pull all the records with given macro it could be html or html-bobswift SELECT distinct s.spaceid,s.spacekey FROM CONTENT c JOIN BODYCONTENT bc ON c.contentid = bc.contentid JOIN SPACES s ON c.spaceid = s.spaceid WHERE c.contenttype IN ('PAGE', 'BLOGPOST', 'COMMENT') AND bc.body LIKE '%ac:name="html"%'; -- Update html with html-bobswift UPDATE bodycontent SET body = replace(body,'ac:name="html"','ac:name="html-bobswift"') WHERE bodycontentid in ( SELECT bc.bodycontentid FROM CONTENT c JOIN BODYCONTENT bc ON c.contentid = bc.contentid WHERE c.contenttype IN ('PAGE', 'BLOGPOST', 'COMMENT') AND bc.body LIKE '%ac:name="html"%' ) ;

Convert html-include to html-bobswift

Execute the given queries:

-- Find all pages with html-include SELECT bc.contentid, bc.body FROM CONTENT c JOIN BODYCONTENT bc ON c.contentid = bc.contentid JOIN SPACES s ON c.spaceid = s.spaceid WHERE c.contenttype IN ('PAGE', 'BLOGPOST', 'COMMENT') AND bc.body LIKE '%ac:name="html-include"%'; -- Update html-include with html-bobswift UPDATE bodycontent SET body = replace(REGEXP_REPLACE( body, '<ac:parameter ac:name="url">\s*<ri:url ri:value="([^"]+)"\s*/>\s*</ac:parameter>', '<ac:parameter ac:name="script">#\1</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>', 'g' ),'ac:name="html-include"','ac:name="html-bobswift"') WHERE bodycontentid in ( SELECT bc.bodycontentid FROM CONTENT c JOIN BODYCONTENT bc ON c.contentid = bc.contentid JOIN SPACES s ON c.spaceid = s.spaceid WHERE c.contenttype IN ('PAGE', 'BLOGPOST', 'COMMENT') AND bc.body LIKE '%ac:name="html-include"%'
  • This solution considers only the current version of the page.

  • Restart the server after executing the update query and verify the html-include macros have been converted to the html-bobswift macros.

Need support? Create a request with our support team.

Copyright © 2005 - 2026 Appfire | All rights reserved.