This morning, I upgraded my server, which runs ArchLinux. As you may know, ArchLinux recently updated their Python packages so that the default python points to python3. Python 2.6 was also updated to Python 2.7 (accessible from python2) Everything went relatively well, but I had to recreate all my virtual environments because they were too tightly integrated with python 2.6. I have one virtual environment for each big application running on my server (Trac, MoinMoin, and my ph.d. project, recodoc) and it took longer than expected... MoinMoin must be the worst wiki on earth because every time I want to update it (either MoinMoin or Python), I get a few extra gray hairs. Here are the steps that worked for me:
- Stop your wsgi/fcgi server (in my case, gunicorn)
- Backup wiki config (share/moin) and wiki data/underlay directories.
- Remove the .pyc files from the backup (e.g., share/moin/config/wikiconfig.pyc)
- If upgrading Python, remove the cache files from the backup:
rm -r path_to_moin/data/pages/*/cache/*
rm -r path_to_moin/underlay/pages/*/cache/*
- Update MoinMoin/Python/Whatever
- Restore share/moin directory and wiki data/underlay directories.
- Restart wsgi/fcgi
Steps 4 and 5 are essential if you are upgrading Python. Indeed, compiled python files are not necessarily compatible from one version to the other (that was my first problem). MoinMoin cache files contain python bytecode that may not be compatible. Backing up the data/underlay directory is not necessary (as long as you delete the cache files when upgrading Python), but I would hate losing my wiki data during an update. Frankly, the only reason I stick with MoinMoin is because it's Python and not PHP. MoinMoin updates are just plain unusable, broken, and evil. Come on, why do I need to run such potentially nasty commands like rm -r with stars? Ok, back to work.