Will's blog

purpose: Will Kahn-Greene's blog of Python, Linux, random content, PyBlosxom, Miro, and other projects mixed in there ad hoc, half-baked, and with a twist of lemon

Fri, 25 Apr 2008

Upgrading to MoinMoin 1.6

A couple of days ago, I did a dist-upgrade on my server which runs Debian. I'm not sure what version I had prior to the upgrade, but after the upgrade I'm at 1.6.2. The problem is that the wiki syntax is different, so my wiki data was mildly hosed. I ended up spending 45 minutes to an hour trying to figure out how to migrate the data.

The magic script is /usr/share/python-support/python-moinmoin/MoinMoin/script/moin.py . You need to run it like this:

$ ./moin.py --config-dir=/path/to/wikiconfig.py/dir/ migration data

The other problem I had is that I had no meta file in my data directory and so the moin.py script would die with a stack trace like this:

Traceback (most recent call last):
  File "./moin.py", line 24, in ?
    run()
  File "./moin.py", line 15, in run
    MoinScript().run(showtime=0)
  File "./../../MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "./../../MoinMoin/script/__init__.py", line 251, in mainloop
    plugin_class(args[2:], self.options).run() # all starts again there
  File "./../../MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "./../../MoinMoin/script/migration/data.py", line 44, in mainloop
    curr_rev = meta['data_format_revision']
  File "./../../MoinMoin/wikiutil.py", line 472, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'data_format_revision'

I assumed that I had some version of 1.5 previously and so I created a meta file with this in it:

data_format_revision: 01050800

After doing that, the moin.py script worked nicely and all my wiki data is in the correct syntax now.

Updated: 4/26/2008 - Fixed some grammar to make the meta file creation step clearer.

Posted by meinhard benn on Sat Apr 26 08:34:28 2008
thanks for the hint! this saved me some headache. :)

the instructions about the meta file are not so clear. so for dummies like me:

before running the migration script you need to create a file called "meta" in the data directory to be migrated. do so by typing

echo "data_format_revision: 01050800" > ./data/meta

yes, i'm a human being! and i am mad as hell! (from the movie "network") ;)


Please keep comments appropriate. I reserve the right to remove anonymous comments, flames, spammy, inappropriate, and other comments that I deem to be worth removing.

Note: New comments get placed in a "draft" status and will NOT show up on the site until I explicitly approve it. Usually that happens within 24 hours, but sometimes I go away and it takes a day or two.

Note 2: There is now a preview button for those of you who want to see a preview! However, it doesn't quite work the way you'd think it should work. I'll look into adjusting it some day.

Note 3: If you can't for some reason post a comment, send me an email: willg at bluesock dot org.

Your name:


Your e-mail address (this doesn't get displayed to anyone--I use it to contact you if there are issues):


URL of your website (optional):


Comment:


Yes, I am a human!

pyblosxom::2.0 dev

All contents Copyright 1996 to 2008 Will Guaraldi.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.