1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/README.txt Tue Jun 05 00:24:45 2012 +0200
1.3 @@ -0,0 +1,77 @@
1.4 +Introduction
1.5 +------------
1.6 +
1.7 +ConfluenceConverter is a distribution of software that converts exported data
1.8 +from Confluence Wiki instances, provided in the form of an XML file, to a
1.9 +collection of Wiki pages and resources that can be imported into a MoinMoin
1.10 +instance as a page package.
1.11 +
1.12 +Prerequisites
1.13 +-------------
1.14 +
1.15 +ConfluenceConverter requires a library called xmlread that can be found at the
1.16 +following location:
1.17 +
1.18 +http://hgweb.boddie.org.uk/xmlread
1.19 +
1.20 +The xmlread.py file from the xmlread distribution can be copied into the
1.21 +ConfluenceConverter directory.
1.22 +
1.23 +The moinsetup program is highly recommended for the installation of page
1.24 +packages and the management of MoinMoin Wiki instances:
1.25 +
1.26 +http://moinmo.in/ScriptMarket/moinsetup
1.27 +
1.28 +If moinsetup is not being used, the page package installer documentation
1.29 +should be consulted:
1.30 +
1.31 +http://moinmo.in/HelpOnPackageInstaller
1.32 +
1.33 +Quick Start
1.34 +-----------
1.35 +
1.36 +Given an XML file for a Confluence Wiki instance (in the example below, the
1.37 +file is called com_entities.xml), the following command can be used to prepare
1.38 +a page package for MoinMoin:
1.39 +
1.40 +python convert.py com_entities.xml COM
1.41 +
1.42 +In addition to the filename, a workspace name is required. Confluence appears
1.43 +to require a workspace as a container for collections of pages, but this also
1.44 +permits us to selectively import parts of a Wiki into MoinMoin.
1.45 +
1.46 +The result of the above command will be a directory having the same name as
1.47 +the chosen workspace, together with a zip archive for that directory's
1.48 +contents. Thus, the above command would produce a directory called COM and an
1.49 +archive called COM.zip.
1.50 +
1.51 +To import the result, use moinsetup as follows:
1.52 +
1.53 +python moinsetup.py -m install_page_package COM.zip
1.54 +
1.55 +This requires a suitable moinsetup.cfg file in the working directory.
1.56 +
1.57 +Troubleshooting
1.58 +---------------
1.59 +
1.60 +The page package import activity in particular can be a source of problems.
1.61 +Generally, any error occurring when attempting to import a package is likely
1.62 +to be due to insufficient privileges when writing to the pages directory of a
1.63 +Wiki or to its edit-log file.
1.64 +
1.65 +The moinsetup software can generate scripts that set the ownership of Wiki
1.66 +files or apply ACLs (access control lists) to those files in order to make
1.67 +access to Wiki data more convenient. Where the ownership of the files must be
1.68 +set (to www-data or nobody), the import step can be run as that user given
1.69 +sufficient privileges. However, the easiest solution is to apply ACLs, thus
1.70 +allowing the user who created the Wiki to retain write access to it.
1.71 +
1.72 +Contact, Copyright and Licence Information
1.73 +------------------------------------------
1.74 +
1.75 +The current Web page for ConfluenceConverter at the time of release is:
1.76 +
1.77 +http://hgweb.boddie.org.uk/ConfluenceConverter
1.78 +
1.79 +Copyright and licence information can be found in the docs directory - see
1.80 +docs/COPYING.txt and docs/LICENCE.txt for more information.
2.1 --- a/convert.py Mon Apr 23 23:52:27 2012 +0200
2.2 +++ b/convert.py Tue Jun 05 00:24:45 2012 +0200
2.3 @@ -237,9 +237,14 @@
2.4 if __name__ == "__main__":
2.5 import sys
2.6
2.7 - filename = sys.argv[1]
2.8 - is_zipfile = splitext(filename)[-1] == extsep + "zip"
2.9 - space = sys.argv[2]
2.10 + try:
2.11 + filename = sys.argv[1]
2.12 + is_zipfile = splitext(filename)[-1] == extsep + "zip"
2.13 + space = sys.argv[2]
2.14 + except IndexError:
2.15 + print >>sys.stderr, "Please specify an XML file containing Wiki data and a workspace name."
2.16 + print >>sys.stderr, "For example: com_entities.xml COM"
2.17 + sys.exit(1)
2.18
2.19 no_translate = "--no-translate" in sys.argv
2.20