Dan L
Dan L

Reputation: 1983

How should I migrate a site from ZWiki to MediaWiki?

I have a fairly extensive wiki on ZWiki on Zope (in turn on Plone). Most pages are in reStructured text format, but there are several in straight HTML as well.

What is the best approach to migrate those pages over to a MediaWiki wiki with pages converted to MediaWiki and HTML formats? Of course I'd like to automagically convert all links (internal and external).

Upvotes: 2

Views: 436

Answers (2)

Simon Michael
Simon Michael

Reputation: 2298

  1. extract your wiki content to files, using the zwikiexport.py script. The command will be something like:

    ZOPE/bin/zopectl run ZOPE/Products/ZWiki/bin/zwikiexport.py /zodb/path/to/wiki/folder

  2. convert the restructured text markup to mediawiki markup. pandoc should work well - for each wiki page, run something like:

    pandoc -r rst -w mediawiki PAGE.rst >PAGE.mw

  3. convert the wiki links, which pandoc doesn't know about. Depending on your content, this may be the hardest part to do accurately. Write a perl script, or modify the zwikiexport script, using Zwiki's knowledge of where the links are (see methods in ZWikiPage.py).

  4. import the mediawiki-format pages into mediawiki, however that's done

  5. refinements:

    • the exported file tree will reflect your zwiki page hierarchy - if you use this heavily, you'll want to think about how to represent it in mediawiki

    • as Mark says, you'll lose the page history, unless you work extra hard to find a way to replicate that. The same goes for all page metadata you may have have been using (you can inspect most of this metadata in the page's Properties tab in the zope management interface). In particular the page creation time, last edit time, and the usernames of the page's creator and last editor are quite important, to understand your content. So I would try to script some way of preserving those or if all else fails, doing it by hand.

    • if you have uploaded files to the wiki, I think the export script might save those too, otherwise use the ZMI to export/save them. When you import them to mediawiki, you may need to choose a page to attach them to. You could use grep or Zwiki's search to find the pages that reference a particular file.

  6. be prepared to iterate, testing the results pretty thoroughly and refining the process, before you declare victory. After that, the content will diverge and you won't want to re-do this.

  7. manual fixups: at some point, it may be cheaper to stop fiddling with scripts and do the remaining cleanup by hand, by yourself or with an army of helpers.

Good luck! - Simon http://zwiki.org

Upvotes: 1

I've no experience of ZWiki and don't know how large your wiki is. But general advice - you can use find / replace in Notepad or Notepad++ - or you can write a macro in Excel.

This is per page copying which is only really suitable if your wiki is not larger than, say, 1000 pages.

I suspect you'll still have manually to check each page though, and update your scripts accordingly.

Good luck with it - I suspect you'll be pleased with the final result because MediaWiki is pretty awesome.

Update: one disadvantage of moving to a new wiki is that you will lose the page history (i.e. who wrote what, when).

Upvotes: 0

Related Questions