Confluence Bulk Import HTML
Asked by Sarah Sand:

Has anyone had any luck with this recently?

We're trying to migrate from one Knowledge base to another. I'm able to pull out the content as a CHM, then convert it to HTML and attachments using a converter. But, I'm having trouble getting the HTML imported into Confluence.

Here are the solutions we're currently trying:

* Built-in Confluence file importer (didn't work - is getting hung up on the fact that the pages are formatted as tables)
* Confluence's REST API calls to create a page and add an attachment (currently working on this)
* Universal Wiki Converter (looks like it's no longer supported, as of a long time ago)
* Bob Swift's Command Line Interface/CLI (loadfiles worked great, but brings it in as HTML code which our users won't be able to support)
* Bulk convert the HTML to PDF files, then use the REST API to create pages and attach the PDF files (currently working on this, at least it keeps the original formatting of the pages)

Thanks for your help!


Answers:
author: Nar Kumar C. - Narva Software
body: For others who are looking for an option to import HTML files in bulk, we have developed alternative to universal importer: [All-in-one File Importer for Confluence](https://marketplace.atlassian.com/apps/1221333/all-in-one-file-importer-for-confluence?hosting=cloud&tab=overview)

You can import multiple files at once or just reference folder and it will import the files under it.

It also supports bulk importing other file formats like Markdown, Microsoft Word etc.


author: Shannon S
body: Sarah,

What's the software that you're trying to import from?

Ideally you would be importing XML files but if you let us know the exact software you're coming from we might have some other suggestions.

Regards,

Shannon

comments: author: Sarah Sand
body: Hi Shannon,

The software is Moxie. The business member who owns the application is trying to get in contact with the vendor to find out what other export formats they can create for us aside from CHM, so there's a chance that XML may be an option.

And I should clarify in case they see this question that we're doing a proof of concept for the conversion.

Thanks for asking!

Sarah


author: Shannon S
body: Hi Sarah,

Thank you for confirming that.

So for external sites, here's what we recommend (see [Import Content into Confluence](https://confluence.atlassian.com/display/DOC/Import+Content+Into+Confluence))

> Import web content
>
> To embed web content on a page:
>
> * Use the [Widget Connector Macro](https://confluence.atlassian.com/display/DOC/Widget+Connector+Macro) to display videos, slide shows, twitter chats, documents and more, sourced from other web sites and displayed on your Confluence page.
>
> * Embed an external web page into Confluence with the [HTML Include macro](https://confluence.atlassian.com/display/DOC/HTML+Include+Macro).
>
> * Use HTML code in a page with the [HTML macro](https://confluence.atlassian.com/display/DOC/HTML+Macro).
>
> Note: The HTML macro is not enabled in all sites. Talk to your Confluence Admin about whether you can use this macro.
>
> Importing content from another wiki
>
> Confluence does not provide a method for importing content from another wiki. You may be able to build your own import solution using our REST APIs, as mentioned below, or work with an [Atlassian Solution Partner](https://www.atlassian.com/partners) to develop a custom solution.
>
> Import other content
>
> Importing non-wiki markup into Confluence requires a conversion process:
>
> * Text with basic formatting can be pasted directly into the editor. This includes simple Word documents or web pages.
>
> * Confluence pages saved to disk can be [imported from disk](https://confluence.atlassian.com/display/DOC/Import+a+Text+File).
>
> * Files can be uploaded in bulk using the Confluence WebDav Plugin. See [Use a WebDAV Client to Work with Pages](https://confluence.atlassian.com/display/DOC/Use+a+WebDAV+Client+to+Work+with+Pages).
>
> * Build your own import solution using the [Confluence APIs](https://developer.atlassian.com/display/CONFDEV/Confluence+Server+REST+API).

You could work with Moxie as you have been, and let them know your options through Confluence, and hopefully they can work with something for you. The XML to import into Confluence must be Confluence generated, so with Moxie, you'll need to go the HTML or basic text route. Another option is if you have a copy of any of your pages as a Word Document, you could import these.It's still worth trying the unsupported options, as it could work depending on your content.

Regards,

Shannon


author: Sarah Sand
body: Thank you very much, Shannon. I appreciate the help!

We'll keep working with Moxie, and trying out the different unsupported options. I'll make a note to come back here once we've found a solution.

For the Word Document option you mentioned, there's not a built-in way to do this in bulk that you know of, is there?


author: Shannon S
body: Hi Sarah,

There's not, unfortunately.

I made a feature request for it a few years ago but it didn't gather much interest and was closed:

* [CONFSERVER-31573](https://jira.atlassian.com/browse/CONFSERVER-31573)

Thank you in advance for updating us when you find a solution!

Regards,

Shannon


author: Sarah Sand
body: Darn, thank you for taking that step! I'll keep that in mind as well. Thanks!


author: Shannon S
body: No worries, Sarah! Keep us updated. :)


Tags: api

cli

html

migration

rest-api

script