-
Suggestion
-
Resolution: Won't Fix
-
None
-
None
-
None
After a few months of having to leave this alone, I finally came to a good stopping point with the TWiki to Confluence migration tool. Attached is the source code for you to have a look at.
This is based on the jspwiki-exporter. I did some refactoring to separate the Confluence-general stuff from the JSPWiki-specific stuff, and then added the TWiki functionality. I think what I ended up with is a good design which can be extended for other Wiki tools. Based on the instructions at http://confluence.atlassian.com/display/DOC/Importing+From+JSPWiki, you should be able to drop this source in places of the jspwiki-exporter-1.4.1b source. All the unit tests are there (100% coverage on the TWiki package along with functional test data in src/test/etc.
After building, the command line options are:
- java -jar wiki-exporter.jar jspwiki path/to/wiki.properties spaceName creatorUserName
- java -jar wiki-exporter.jar twiki path/to/wiki.properties creatorUserName
The wiki.properties file for the TWiki exporter just needs one property (twiki.basedir) which points to the directory that contains the data and pub directories that TWiki uses to store pages and attachments.
I started with the 1.3 version of jspwiki-exporter. I made a few updates to get it in line with 1.4.1, but there is probably more merging that needs to be done between JspWikiBackupExporter.java in the 1.4.1 source and the com.atlassian.confluence.export.jspwiki package in my code. I don't have the jspwiki-exporter 1.3 source any more, so I can't look for the differences and merge them forward.
Here is a list of features in the TWiki exporter:
- Full attachment support
- Multiple TWiki webs exported to Confluence spaces
- Converts TWiki syntax to Confluence syntax, including:
o text formatting
o headings and breaks
o wiki links
o image and attachment links
o lists
o tables - Converts HTML tags to Confluence syntax, including:
o bold, italics, code, emphasis
o block quote, header
o href links
There are combinations of TWiki markup that don't get properly converted, but I haven't had the time to thoroughly test all possibilities. I migrated all of our content (a few hundred pages) and cleaned up the nits manually. Besides a more thorough test data set, things on my to-do list that I haven't gotten to are:
- Properly Spring-enable the exporter (i.e. get rid of JSPWikiConfluenceExporter.java and TWikiConfluenceExporter.java)
- Support migrating user links (TWiki [Main.UserName] to Confluence userid)
- Migrate page history
- Migrate page author (instead of using creatorUserName cmd line arg) and modification date
- Convert additional HTML tags to Confluence markup
Let me know if you have any questions.
Scott Frederick
leaving this in the hands of the author for now.