MailManager migration woes
Thursday, November 3, 2005 at 6:55PM - 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! )
Reader Comments