How to switch from dmigrations to South

Posted by james on July 27, 2010

I used to use dmigrations for django. Dmigrations is a database migrations library that makes keeping DB schemas up-to-date so easy & reliable. When you're a single developer, with only one dev machine and one server, this isn't as much an issue. Once you have teams (or multiple servers), this becomes necessary. But even for the single dev, once you use managed migrations you'll want to use it for everything.

I first started using dmigrations, which was nice but had a few bugs. One of the glaring ones: there's a typo in the codebase (which can only be checked out via SVN) that has existed there for a long, long time, and prevents normal operation. Why hasn't this been fixed? Because dmigrations has been abandoned. Supposedly, even the authors recommend using south instead.

So along comes South. South addresses the same problem, but is much better in just about every way (with the caveat that it's slightly more complicated, but not much). South handles more, better, cleaner, etc.

So here's how I took my dmigrations webapp and converted it to use south instead:

  1. Backup your mysql database!

  2. Now edit

  3. Remove 'dmigrations' from INSTALLED_APPS, add 'south'.

  4. Remove the DMIGRATIONS_DIR and DISABLE_SYNCDB (if you have that) vars.

  5. From the command prompt:

  6. > del migrations\*

  7. > schemamigration app_name --initial

  8. > syncdb

  9. > migrate --fake