MySQL to MongoDB conversion

For photostre.am I wrote an migration script to migrate the MySQL database to MongoMapper.

Maybe it’s good use for someone, this is the actual script at gist.github.com and no abstract something which you give up to extend after a while. The migration actually uses ActiveRecord::Migration, could well be about the last one that I’ll ever write.

Lessons learned:
  • Keep the old id from MySQL for a while, but rename it
  • Don’t do too many EmbeddedDocuments

Leave a Reply