Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

migrate html content into confluence

I am trying to migrate an old Knowledge Base into Confluence but I can only get the content as HTML files inside of an SQL dump.
Is there any way I can migrate all of the articles in the SQL dump into a Confluence space?
I have tried UWC but it does not recognize SQL DB's.

2 answers


How I would approach this problem:

  • Will extract the HTML content from the SQL dump into files and will create the directory structure I want/need
  • Will create an empty new space in Confluence
  • Will write a simple script that will traverse the files and will use Confluence REST API to import each file as new page

A little bit of work, yeah... but not that complicated wink

Thanks! I will check this out. So how will this work if I have a template in the Confluence space I want to use so all articles are organized in the same way? I know that all new articles going forward will use the template but I am not sure if an import can be told to use a template format.

So, you get your Template as HTML and merge it with the HTML from the file and use the merged result to put it inside confluence (via rest api as mentioned earlier)

How would I tackle the first bullet you listed (extract the HTML content from the SQL dump)?

It depends on how you want the HTML content retained and whether it is a one time import. There are a few choices.

  1. Create pages with the HTML content imbedded in an html macro. Either use the system supplied html macro (must be enabled) if you only have trusted users on your site or use the HTML Macro included with HTML for Confluence that can be secured with Macro Security for Confluence. You can use the Confluence SOAP or REST apis to create the page content if you have those skills or use storePage from Confluence Command Line Interface (CLI)
  2. Put the files in the file system so they can be referenced by the HTML Macro (can't use the built-in html macro) and then create your pages as in 1) except the page content would just be a single HTML Macro with no body that references the file as a parameter.
  3. Attach the files to Confluence. For instance, using addAttachment from Confluence Command Line Interface (CLI). Do the same as 2), except reference the attachment instead of the file system.
  4. If your html is really clean (well formatted) and you only need to do the import once, you might be able to import it directly into a page (without using html macro) using storePage with the noConvert option. 


I am glad to hear I have some options. I will look into these. Thanks!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence Cloud

Please tell us how you use Confluence space settings

👋 Hi there, a few of us at Atlassian would love to learn about how you use "space settings" functionality in Confluence. A facelift to the space settings is long overdue and we want to start with im...

567 views 15 9
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you