Migration from moin 1.5 to 1.6 (and beyond)
About this HowTo
- MoinMoin versions
- 1.5.3 (as base) and 1.6.x, 1.7.x, 1.8.x (as target)
- Platforms
- Linux, maybe other POSIX
This is my (ThomasWaldmann's) non-standard way to do the 1.5.[3456789] > 1.6.x migration (and beyond).
General Notes
- have a good backup
- be careful with owner/group and mode, use chown / chmod appropriately
Migrating the data_dir
- unpack moin-1.6.x.tar.gz to your workdir (you can also use a more recent target version)
- . (dot) means that workdir now, ever!
- when entering commands, stay in that workdir!
- ./wikiconfig.py, ./wiki/data are the conversion wiki
- somewhere else on your disk is your production wiki
- The next steps look like a minor detail, but it is really important to do:
- look into your old (production) wiki config, look up the interwikiname and sitename
- put interwikiname and sitename into ./wikiconfig.py, please indent correctly
- in case you have some special interwiki map (with own stuff), make sure to also have it available and configured in the conversion wiki
- move ./wiki/data out of the way to ./wiki/data.orig16
- copy your production data_dir to ./wiki/data
- optionally use moin maint cleanpage to clean up before migrating
enter: python MoinMoin/script/moin.py maint cleancache
- this clears the "pre-compiled pages" cache
- remove the contents of ./wiki/data/cache/
- these are misc. other caches
- review the content of ./wiki/data/plugin/ (not all plugins are compatible to 1.6!)
enter: python MoinMoin/script/moin.py migration data
- phase 1, it will collect some mapping data and write it to ./wiki/data/rename1.txt
the command will give you some hints at the end, read and follow them!
in case you ever wanted to rename some page AND all the links to it, do it now!
- if you don't want to have _ (underscores) in pagenames, replace them by blanks
- and vice versa!
- rename ./wiki/data/rename1.txt to ./wiki/data/rename2.txt
enter: python MoinMoin/script/moin.py migration data
- phase 2, it will migrate your data to 1.6 now, doing the renamings as told by rename2.txt
- the conversion result will be in ./wiki/data
- ./wiki/data.pre160 has the input data of phase 2 - in case you want to run phase 2 again you can rename this to data...
review conversion results by running the standalone server and targetting your browser to http://localhost:8080/
- for 1.6, the standalone server is started by ./moin.py
- for 1.7 and later, it is started by ./wikiserver.py
- converted pages have a new revision with a comment from the converter
- diff that revision to the revision before to see what the converter did
- if you are happy with what you see:
- Throw away your old production data_dir (of course do NOT throw away your backup of it!).
- Copy ./wiki/data to the production data_dir location.
Replacing the underlay pages
- Throw away your old production underlay_data_dir (it should not have any data of you).
- Copy ./wiki/underlay to the production underlay_data_dir location.
Replacing the static files
This is for the case that your are just using the standard moin themes, if you have special themes, you need to be more careful!
- Throw away your old production static directory (the stuff that the web server served when accessing url_prefix).
- Copy the contents ./wiki/htdocs to that location.
- you likely have to reconfigure your web server, the new url_prefix_static default is /moin_static160 (for moin 1.6.0) - the old default was /wiki
Edit your (production) wiki config
- you have to read ./docs/CHANGES for that
Update your server script and the moin code
This heavily depends on your installation / configuration. Here are some ideas for CGI and a moin installed via setup.py:
- update your moin.cgi with the one you find in ./wiki/server/moin.cgi
edit the new file, especially fix the sys.path.insert stuff to point at the correct places (see the old file)
- make sure owner/group/mode is the same like the old production moin.cgi
- strongly recommended: remove the old moin installation, it is likely located there:
- /usr/lib/python2.x/site-packages/MoinMoin
- /usr/share/moin
install the new moin using python setup.py install
If you are not using CGI, but some persistent server, don't forget to restart your server / moin process for any configuration change.
Problems?
KeyError: 'data_format_revision'
That just means that the data/meta file is missing.
The last "old style" migration script creates this file when you migrate from 1.5.2 to 1.5.3.
Please make sure you have moin 1.5.0 .. 1.5.3 (and not 1.3.x or even older), otherwise you will have to use more of the old mig scripts.
Just look into that mig script to learn how to use it:
MoinMoin/script/old/migration/152_to_1050300.py