public
Description: Rake task to convert a Rails database from one platfrom to another, say Postgres to MySQL and back again. Uses two open db adapters and works with binary data in blobs.
Homepage: http://myutil.com/2008/8/31/rake-task-transfer-rails-database-mysql-to-postgres
Clone URL: git://github.com/face/rails_db_convert_using_adapters.git
face (author)
Fri Oct 10 16:35:32 -0700 2008
commit  16feabbb905e442575b7e0fd97377737d70207a5
tree    db007877b54c73a73f87e312c6c19f6799a15936
name age message
file BSD-LICENSE Loading commit data...
file README.rdoc
file convert.rake
README.rdoc

convert.rake

Rake task to convert and transfer a Rails database from one database platform to another using two open db adapters. For example, from Postgres to MySQL, or the reverse.

The task deletes all data in the development database and then transfers the data from the production database into the development database.

Features

  • Nice to RAM on large data sets
  • Works with blobs

Assumptions

  • No writes are happening to either database for the duration of this task.
  • Both schemas are identical (i.e. migrations are at the same VERSION)
  • The development data can be removed and replaced.

Usage

For a detailed example please see: myutil.com/2008/8/31/rake-task-transfer-rails-database-mysql-to-postgres

Place convert.rake in your lib/tasks directory.

       rake db:convert:prod2dev