Updating MoinMoin - Major Python Update on ArchLinux

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:

  1. Stop your wsgi/fcgi server (in my case, gunicorn)
  2. Backup wiki config (share/moin) and wiki data/underlay directories.
  3. Remove the .pyc files from the backup (e.g., share/moin/config/wikiconfig.pyc)
  4. 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/*
  5. Update MoinMoin/Python/Whatever
  6. Restore share/moin directory and wiki data/underlay directories.
  7. 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.