Tags:
import1Add my vote for this tag create new tag
, view all tags

Zwiki to TWiki Add-On

I've a method for migrating just the latest version of each page.

Inside the zwiki site, create a python script (using the management interface) like so:

items = context.objectValues(['ZWiki Page'])
for wikipage in items:
   print '-----------------------------------------------------------'
   print wikipage.Title()
   print '----'
   print wikipage.raw
return printed

Then do something like this:

$ wget -r -np http://foo.bar/zwiki/my_export_script

Then save the following python to a file in the same dir as the stuff you downloaded.

#!/usr/bin/python
import sys
import os
f = file(sys.argv[1])
data = f.read().strip()
stuff = data.split("-----------------------------------------------------------")
bits = []
for bit in stuff:
   bits.append(bit.split("\n----\n"))
try:
   os.mkdir('zwiki')
except:
   pass
for bit in bits:
   try:
      f1 = file(os.path.join('zwiki',bit[0].strip()),'wb')
   except:
      continue
   f1.write(bit[1].strip())
   f1.close()

Now run it:

$ cd foo.bar/zwiki
$ python zwiki-split.py my_export_script

It will create a zwiki dir with a bunch of files which you can import to twiki. The import step and the inevitable cleanup of the resulting pages are manual at this stage.


Have a look at the extension of this script described at ZwikiToTWikiAddOnDev

-- TobiasEscher - 2009-07-02

Add-On Info

  • Set SHORTDESCRIPTION = Convert Zwiki content into TWiki format

Add-on Author: TWiki:Main/PaulWise
Add-on Version: 02 Feb 2005 (v1.000)
Change History:
02 Feb 2005: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
License: Public Domain
Add-on Home: http://TWiki.org/cgi-bin/view/Plugins/ZwikiToTWikiAddOn
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ZwikiToTWikiAddOnDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ZwikiToTWikiAddOnAppraisal

Related Topic: TWikiAddOns

-- TWiki:Main/PaulWise - 02 Feb 2005

Topic revision: r9 - 2011-08-23 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.