Search

Enter a search word or two and press return to see the search results.

Who am I?

Hi, I’m Graeme and these are my notes, from my messy desk. I started this blog because Google proved to be more useful at finding content than anything else I’ve used.

So I started adding my own content in the hopes that Google would index it and allow me to find things again in the future.

It works.

You can find out more about me here, and you should follow me on Twitter here.

Keeping up

You can automatically receive new content here by subscribing to the “Blog RSS” (link below). This is the easiest way to keep up with what I write here.  See this BBC article for a good introduction on RSS and keeping up with the goings on of the Internet more easily.

« MySQL, Zope and Unicode | Main | Telephone User Interfaces »
Thursday
Nov032005

MailManager migration woes

Here I am, trying to convince MailManager to cleanly migrate from version 1.1 (which used the ZODB backend to store message data) straight to 2.0.3 on MySQL. And you know, incredibly, I think I've just convinced it to work! Now it just needs tidied up enough to commit (and to check the PostgreSQL migrations still work). There were a couple of problems:


  • We forgot to offer MySQL as a migration path. Oops. :-)

  • The MySQL text search indexes are updated by addTicket() on the fly, so they need to be created at the start of the migration (not at the end, as happens with PostgreSQL, for performance reasons).

  • The MySQL tables were created with their default encoding which, on my laptop was ASCII, not UTF-8.

  • The ZMySQLDA (the database adapter between Zope and MySQL) has its encoding set to ASCII. There are apparently various possibilities for convincing it to talk UTF-8 (as discussed in this thread on zope-db) but the only one that has worked for me is to insert the following in sitecustomise.py:

    [code lang="python"]import sys
    sys.setdefaultencoding('utf-8')[/code]

    which changes the setting globally for your entire Python installation. Not ideal, but now our application works and who cares about every other Python program on the system? :-)



And now there's a weird one. During the migration, somehow attachments are downloaded to the browser! This was most entertaining while I was testing with an old dataset of our own and it was crashing after having processed only one attachment. As it crashed, Preview would pop up with a 3 page PDF quote from Rackspace for one of the servers we ordered a while back! This was a repeatable feature! Now it just seems to download all the attachments as one lump, dumping them into a file called migrate. But the first time was really freaky!

I should mention, by the way, that these 'features' only affect a tiny subset of MailManager users: those who are upgrading from 1.1 to 2.0.x and want to use MySQL as the database backend. (And hopefully this should be fixed by 2.0.3's release!) Folks who have just deployed a new instance on MySQL aren't affected and those who are sensible enough to use PostgreSQL wouldn't have any bother at all! (I wonder if I'm allowed to say bad things about MySQL now that we're a certified gold partner? :-) I certainly doubt it's going to encourage them to fix the spelling of my surname! )

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>