Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I import and convert Wiki markup to confluence through API?

Leon André Bergman February 16, 2023

We have a MediaWiki that needs to be migrated over to Confluence.

The amount of pages that needs to be moved is too big to do it manually, so we are developing an automated process where we export all pages to xml from the mediawiki, then get the text from that xml, and create new pages in confluence.

I saw that there was previously a tool to convert this, (UWC) but all posts about this is from 2018 or earlier, and already at that time it was abandonware.

I found that the API should be able to convert wiki text if you set representation to wiki, but it does not convert the text. 

I've tried a call that looks like this to our sandbox:



    "type":"page"

    "title":"Test"

    "space":{

        "key":"MWK"

        }, 

    "body":

        {

        "storage":

            {

            "representation":"wiki",

            "value":"== '''RSD's CRID:''' =="

            }

        }

    }

And the result is a page with the title Test, and the text is simply 

 

== '''RSD's CRID:''' ==

 

Am I doing something wrong? Or does this conversion method not work, despite it being documented in the API?

Are there any other methods to convert the text? My google fu has not found any easy solutions as of yet.
My thinking is that I need to create some text replace logic that replaces wiki markup with HTML, but it'll be tricky and finicky to get the close tags.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events