Database Query to Locate Unmigrated Wikimarkup Pages
Scenario
After upgrading to confluence 4.x onwards, the editor was changed from the wikimarkup to the new XHTML editor. The upgrade should migrate all confluence content from the old to the new editor automatically, however there are times in which the migration doesn't finish. In those cases, we must analyze the reasons why it failed.
Additionally, attempting to rerun the migration or force it, doesn't help in fixing the issue.
Diagnosis
Unfortunately the interface doesn't provide a list of the unmigrated pages, just a message: "There was x pages with unmigrated wikimarkup content".
Resolution
Run the following query to retrieve all the unmigrated pages
SELECT * FROM CONTENT WHERE CONTENTID IN ( SELECT CONTENTID FROM BODYCONTENT WHERE BODY LIKE '%unmigrated-wiki-markup%' OR BODY LIKE '%unmigrated-inline-wiki-markup%' OR BODYTYPEID IS NULL OR BODYTYPEID = 0) AND PREVVER IS NULL AND CONTENT_STATUS != 'deleted' AND CONTENTTYPE IN ('PAGE','BLOGPOST') AND DRAFTPAGEID IS NULL;
With the pages in hand, you can verify their contents and remove unsupported macros or third party plugins from them.