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
Related Topic: TWikiAddOns
--
TWiki:Main/PaulWise
- 02 Feb 2005