Can the current UWC work with Confluence 5?
Asked by Matthew E. Merkelson:

I've been trying to do some moinmoin conversion to Confluence using the UWC. I keep getting the messages:

2013-04-04 13:00:02,900 INFO \[main\] - Building Hierarchy.  
2013-04-04 13:00:02,901 ERROR \[main\] - .... unexpected name: null/null/1 - SKIPPING  
2013-04-04 13:00:02,901 ERROR \[main\] - .... unexpected name: null/1 - SKIPPING  
2013-04-04 13:00:02,901 INFO \[main\] - Uploading Pages to Confluence...  
2013-04-04 13:00:02,901 INFO \[main\] - Page 'Home' does not exist. Creating it now.  
2013-04-04 13:00:04,900 INFO \[main\] - Conversion Complete

The data is in a very simple structure. Any thoughts on work-arounds?


Answers:
author: Doug Dixon
body: It definitely works with Confluence 5. Including page hierarchies. And you don't have to run the MoinMoinPreparation class (in fact you shouldn't - the required bits are called for you)

I have worked out the required config and have made some improvements to the MoinMoin conversion code and regular expressions. I'll submit this back if I remember/get a chance - let me know if you're keen.

comments: author: Sorin Sbarnea (Citrix)
body: Really interested about your changes as I do want to import a MoinMoin instance. Where is you repo? :)


author: Sorin Sbarnea (Citrix)
body: Something is clearly not right. When I try to run the exported I it seems to detect the pages incorectly, finding all the files from /data/pages as page, and as you know these are not really the page. It does also find the attachments as pages!?Also this error seems to be against what is documented:2015-07-30 17:18:40,527 INFO \[main\] - Initializing Converters...2015-07-30 17:18:40,540 ERROR \[main\] - Converter ignored -- name pattern not recognized: history2015-07-30 17:18:40,540 ERROR \[main\] - Converter ignored -- name pattern not recognized: out2015-07-30 17:18:40,541 ERROR \[main\] - Converter ignored -- name pattern not recognized: src2015-07-30 17:18:40,541 INFO \[main\] - Initializing Pages...


author: Sorin Sbarnea (Citrix)
body: 2015-07-30 17:20:44,566 INFO \[main\] - Initializing Pages...2015-07-30 17:20:44,787 INFO \[main\] - Converting pages...2015-07-30 17:20:44,787 INFO \[main\] - -------------------------------------2015-07-30 17:20:44,787 INFO \[main\] - converting page file: samsung_840_ssd.pdf2015-07-30 17:20:44,886 INFO \[main\] - time to convert 99ms2015-07-30 17:20:44,886 INFO \[main\] - -------------------------------------2015-07-30 17:20:44,886 INFO \[main\] - converting page file: m500_ssd_product_brief_lo.pdf2015-07-30 17:20:44,891 INFO \[main\] - time to convert 5ms2015-07-30 17:20:44,892 INFO \[main\] - -------------------------------------2015-07-30 17:20:44,892 INFO \[main\] - converting page file: edit-log2015-07-30 17:20:44,892 INFO \[main\] - time to convert 0ms2015-07-30 17:20:44,892 INFO \[main\] - -------------------------------------2015-07-30 17:20:44,892 INFO \[main\] - converting page file: pagelinks2015-07-30 17:20:44,892 INFO \[main\] - time to convert 0ms2015-07-30 17:20:44,892 INFO \[main\] - -------------------------------------2015-07-30 17:20:44,892 INFO \[main\] - converting page file: text_html2015-07-30 17:20:44,893 INFO \[main\] - time to convert 1ms2015-07-30 17:20:44,893 INFO \[main\] - -------------------------------------


author: Doug Dixon
body: Hi Sorin. Sorry for the delay, I've been away. I'll share my changes when I get a chance!


author: Doug Dixon
body: OK! Finally pulled out finger. Check out the latest couple commits here - I used this to convert a 1000+ page MoinMoin wiki to Confluence 5, with page hierarchies and attachments <https://bitbucket.org/clownfishfingers/universal-wiki-converter-moinprovements>


author: Ellen Feaheny [AppFusions]
body: See the note here -

<https://migrations.atlassian.net/wiki/display/UWC/Universal+Wiki+Converter>

comments: author: Matthew E. Merkelson
body: Okay. Can you address the question in the title: Can the current UWC work with Confluence 5?


author: Ellen Feaheny [AppFusions]
body: We are working on a Confluence Migration Toolkit -

Simplified from the current UWC.

We'll see if this helps the situation going forward. It is tricky problem.

Contact [info@appfusions.com](mailto:info@appfusions.com) for more info.

Best,

Ellen


author: Sorin Sbarnea (Citrix)
body: UWC is not really mantained by AppFusions, probably because they have a direct business interest in selling their value added services.

For this reason @Sorin Sbarnea created a community driven fork of UWC where anyone can contribute, without any unselling interests.

Obviously support is not officially provided, but at least you should be able to fix things yourself and share your contributions with others.

Check: <https://github.com/AtlassianContribs/universal-wiki-converter/wiki> and ask to added as a contributor, so you can contribute without waiting for someone to accept your pull requests.

comments: author: Doug Dixon
body: Thanks. How do I request to be added as a contributor?


author: Sorin Sbarnea (Citrix)
body: I already invited you on github, check you email and accept the invitation.Also, for others I recommend them to add a comment on <https://github.com/AtlassianContribs/universal-wiki-converter/issues/1> -- this would allow us to identify the correct github account to add.


author: Doug Dixon
body: I have a git diff plus some config files to share.... no attachment button here. GAH!


author: Patrick F. Allen
body: I was able to push MoinMoin into Confluence 5.x after figuring a few (undocumented?) things out and using a few workarounds. What I did is hacky but it worked for me. This may not work if you use sub-pages in MoinMoin (or maybe it will, I don't use them).

1. In the conf/converter.moinmoin.properies file, make sure content-hierarchy-default-root is set to the real name of MoinMoin's start page. This should show up at the top of in MoinMoin when you connect to the "main" MoinMoin wiki page with a web browser.

2. I found a "MoinMoinPreparation" tool in the UWC source in "com/atlassian/uwc/prep/MoinMoinPreparation.class". I don't know if I needed to use this or not, but I used that on the Moin pages directory and output the results to a new directory. I used the new "prepped" directory in the UWC tool as the "pages", "attachments", and "src" directories.

3. This is the hacky part. I tweaked some UWC code to get around some underlying problems in making the content hierarchy. In ContentHierarchy.getAncestorNodeMap, I commented out the "if (! hasCurrent)" conditional and the conditional block that followed it. Also in getAncestorNodeMap, I changed the "hierarchy" variable instantiation to: "String hierarchy = page.getName();". This "should" get you a flat hierarchy.

When I recompiled and ran the conversion, there was one main page and all other pages were children to that.

Edit: Also, the conversion wasn't flawless -- some links weren't created, looks like pictures got removed -- but I think all the pages made it over. Pretty happy with that.  

Hope this helps someone.

comments: author: Neile Havens
body: Thanks for your suggestions. They got me the closest to a working conversion. I've run out of time to work on this. Unfortunately, I'm still getting the following error regardless of the settings I try.

```
2014-03-13 13:26:17,731 INFO ?[Thread-2] - ::: total time to convert files: 1 seconds.2014-03-13 13:26:17,731 DEBUG [Thread-2] - Engine Saves To Disk setting turned off.2014-03-13 13:26:17,731 DEBUG [Thread-2] - Checking Pages object is valid.2014-03-13 13:26:17,731 DEBUG [Thread-2] - --&gt; Pages object is valid.2014-03-13 13:26:17,733 DEBUG [Thread-2] - Page root set to: FrontPage2014-03-13 13:26:17,733 DEBUG [Thread-2] - comparing: FrontPage and FrontPage2014-03-13 13:26:17,733 ERROR [Thread-2] - Unexpected problem while converting: nulljava.lang.NullPointerException	at com.atlassian.uwc.hierarchies.ContentHierarchy$VersionComparator.compare(ContentHierarchy.java:355)	at java.util.TreeMap.compare(TreeMap.java:1188)	at java.util.TreeMap.put(TreeMap.java:531)	at java.util.TreeSet.add(TreeSet.java:255)	at com.atlassian.uwc.hierarchies.HierarchyNode.addChild(HierarchyNode.java:62)	at com.atlassian.uwc.hierarchies.ContentHierarchy.getPenultimateNode(ContentHierarchy.java:174)	at com.atlassian.uwc.hierarchies.ContentHierarchy.buildHierarchy(ContentHierarchy.java:58)	at com.atlassian.uwc.ui.ConverterEngine.convert(ConverterEngine.java:415)	at com.atlassian.uwc.ui.ConverterEngine.convert(ConverterEngine.java:217)	at com.atlassian.uwc.ui.UWCGuiModel.convert(UWCGuiModel.java:180)	at com.atlassian.uwc.ui.listeners.ConvertListener$Worker.construct(ConvertListener.java:277)	at com.atlassian.uwc.ui.SwingWorker$2.run(SwingWorker.java:110)	at java.lang.Thread.run(Thread.java:744)2014-03-13 13:26:17,735 ERROR [Thread-2] -?Conversion Status... NONE
```


author: Erik
body: Wow that's freaky i'm getting exactly the same error. About to just go hire an intern...


author: matthew zimmerman
body: I'll add a "Me Too" to the same problem.


author: Matthew E. Merkelson
body: Am I write in assuming the regex of the converter properties file creates an input file in the old Confluence format which is then converted into the XHTML that Confluence is currently stored as?


author: Ellen Feaheny [AppFusions]
body: We are working on a Confluence Migration Toolkit -

Simplified from the current UWC.

We'll see if this helps the situation going forward. It is tricky problem.

Contact [info@appfusions.com](mailto:info@appfusions.com) for more info.

Best,

Ellen


author: Matthew E. Merkelson
body: I've been able to get the current UWC to work with Confluence 5. The problem is with how it handles (or doesn't) Moin Moin.

comments: author: Ellen Feaheny [AppFusions]
body: Yes, Moin Moin is a flavor that had not had as much customer push as others, like for example MediaWiki.

We probably could do some tweaks on it to help you, unless you have gotten it there yourself.

The trouble with the UWC is that it relies on real and many migration environments, and many flavors. There are 100s on "FROM" flavors - and they all have their own nuances.

A UWC ubiquotious tool for all angles and corner cases is a dream.

Therefore, as I have mentioned other places in Answers - again, it is a tool, not a solution.

The solution is UWC + AppFusions consult, or UWC + DIY (do it yourself) - either way. AppFusions only helps get you there quicker.


Tags: universal-wiki-converter