Upgrade of Confluence from 3.5 to 5.0 with Numbered Headings plugin

We have a Confluence 3.5 that uses Numbered Headings v 2.0.3 plugin. After we upgrade Confluence to 5.0 and then update the plugins using Universal Plugin Manager, a lot of pages that use Numbered Headings macro get messed up: TOC macro shows an exception, some pages get truncated, etc.

When such pages are open for edit, they show an unrecognized numbered_headings macro. The manual fix is to create a new Numbered Headings macro, and move content from the old numbered_headings macro to this new one.

Is there any way to have Confluence and Numbered Headings plugin upgraded without having to manually fix all the pages that use it? We have hundreds of these pages...

3 answers

1 accepted

The problem turned out to be caused by our own user macro {numbered_headings} and not by the {numberedheadings} macro that comes from the plugin. The solution was to programmatically modify affected pages and replace numbered_headings with numberedheadings using Confluence CLI.

This is caused by the fact that the last version of Numbered Headings does not contain the macro for pre 4.0 versions. This pre 4.0 version is needed to migrate the macro to the 4.0 version. To solve this bug you should upgrade to version 2.3.1, run all macro upgrades and then upgrade to the latest version of Numbered Headings.

Let me know if it worked!

How do I run macro upgrades? Thank you!

You can update the content on the following page (don't forget to replace the first part of the link): <your_instance>/admin/unmigratedwikicontent.action

I ran this task with 2.3.1 installed on Confluence 5.0, and it looked as it completed without errors, however the pages with numbered_headings old-style macro didn't get changed. Next I will try redoing the whole Confluence upgrade from 3.5 to 5.0 with plugin's version 2.3.1 installed on Confluence 3.5 prior to upgrade. Will post the results here.

Tried starting from the beginning: got a new clone of production (Confluence 3.5, Numbered Headings 2.0.3), updated Numbered Headings to 2.3.1, then upgraded Confluence to 4.3.7, ran content update as suggested. It didn't return any errors, but didn't seem to update the old numbered_headings macro. Then upgraded Confluence to 5.0.3, leaving Numbered Headings at 2.3.1. Got exactly the same result as before, all the pages continue to have "numbered_headings" macro, and have TOC macro that sits right before numbered_headings macro showing an exception: Error rendering macro 'toc' : [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxParsingException: Duplicate attribute 'id'. at [row,col {unknown-source}]: [65,134].

Are both Numbered Headings and the TOC macro broken, or only the TOC macro?

All pages that had {toc} followed by {numbered_headings} now show exception instead of the TOC.

In addition to that, some (not all) pages that use {numbered_headings} macro don't render content inside the macro correctly with different kinds of problems: one page is trancated only showing 1st section, but in Edit mode the whole content is shown. Another has a {warning} macro inside {numbered_headings}, and this Warning box is shown with the text partially written outside of the box.

In all cases the fix is to Edit the page, add a new Numbered Headings macro, and move the content of old {numbered_headings} macro in it, deleting the old {numbered_headings} macro at the end.

My apologies. Further investigation showed that the offiending macro {numbered_headings} belongs to a User Macro added to our instance of Confluence long time ago, before this plugin was even installed. The problem I was describing therefore has nothing to do with the Numbered Headings plugin. Thank you!

No problem, if you need any help with Numbered Headings or any of our other plugins, let us know!

You can update the content on the following page (don't forget to replace the first part of the link): <your_instance>/admin/unmigratedwikicontent.action

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

356 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you