A fresh supply of thoughts about Web Development & Mac OS X
While recently migrating Tschitschereengreen.com from Symfony to Django plus changing the database backend from MySQL to PostgreSQL, there were mainly two tasks more time-consuming than I’ve had thought beforehand:
The old database used a latin1 encoding for the database fields and utf-8 as the server and client connection encoding. With these settings, even trying to get a correctly encoded database dump from phpMyAdmin is a bad idea.
Using mysqldump with an explicitly specified character-set is much better:
mysqldump … –default-character-set=latin1 –skip-set-charset dbname > dump.sql
After realizing that changing a MySQL dump to a valid PostgreSQL dump might take some time, Django’s ability to import and export database fixtures in JSON was a great alternative.
There were, however, a few corrections needed in order to import the data in PostgreSQL:
Published: March 26, 2008 — Tagged: django, mysql, php, postgresql, python, symfony
© 2008 Arthur Koziel — About | Archive | Colophon | Contact | Feeds