This migration step is only necessary for the pre-4.0.0 versions of this app.
If the Confluence Server or Data Center instance has never run a version older than 4.0.0, this migration process is not necessary.
Since there are differences between rules for macro names between Confluence Cloud and Confluence Data Center/Server, the macro names have to be modified in the database before the migration to Confluence Cloud takes place.
The following guideline is based on an Atlassian's article. After finish all steps, you can follow this Atlassian's migration guideline to import the data from Confluence Data Center/Server to Confluence Cloud.
(Optional) Get a report on the pages using the macros
The following SQL query provides this information from the latest (current) version of pages using the old macros. This is targeting pages, blog posts, and page comments.
If Collaborative editing is enabled, we also need to touch the shared draft of target pages.
The following SQL query provides information on shared drafts (pages and blog posts) using the old macro.
Update the content of Pages, Blog posts, and Page Comments
Run the following SQL query to update the content of Pages, Blog posts, and Page Comments.
LaTeX block macro
UPDATE bodycontentSET body =replace(body,'ac:name="LaTeX block"','ac:name="latex-block"') WHERE bodycontentid in (SELECT bc.bodycontentidFROM CONTENT cJOIN BODYCONTENT bcON c.contentid = bc.contentidWHERE c.contenttype IN ('PAGE', 'BLOGPOST', 'COMMENT')AND bc.body LIKE'%ac:name="LaTeX block"%');
LaTeX inline macro
UPDATE bodycontentSET body =replace(body,'ac:name="LaTeX inline"','ac:name="latex-inline"') WHERE bodycontentid in (SELECT bc.bodycontentidFROM CONTENT cJOIN BODYCONTENT bcON c.contentid = bc.contentidWHERE c.contenttype IN ('PAGE', 'BLOGPOST', 'COMMENT')AND bc.body LIKE'%ac:name="LaTeX inline"%');
Update shared drafts
If Collaborative Editing is enabled, update the body of shared drafts.
LaTeX block macro
UPDATE bodycontentSET body =replace(body,'ac:name="LaTeX block"','ac:name="latex-block"') WHERE bodycontentid in (SELECT bc.bodycontentidFROM CONTENT cJOIN BODYCONTENT bcON c.contentid = bc.contentidWHERE c.content_status ='draft'AND c.contenttype IN ('PAGE', 'BLOGPOST')AND bc.body LIKE'%ac:name="LaTeX block"%');
LaTeX inline macro
UPDATE bodycontentSET body =replace(body,'ac:name="LaTeX inline"','ac:name="latex-inline"') WHERE bodycontentid in (SELECT bc.bodycontentidFROM CONTENT cJOIN BODYCONTENT bcON c.contentid = bc.contentidWHERE c.content_status ='draft'AND c.contenttype IN ('PAGE', 'BLOGPOST')AND bc.body LIKE'%ac:name="LaTeX inline"%');
Start the Synchrony process
If Collaborative Editing is enabled and Synchrony is running on a standalone cluster, start the Synchrony process on each node following your standard procedure.
Start Confluence
Start Confluence following your standard procedure. If running Confluence Data Center, start Confluence on each node at a time.