Migrating from MySQL to PostgreSQL
Date:
2015-12-13
Tags:
ruby
rails
data
I recently moved from a self-hosted MySQL database to a free instance of Postgres on Heroku.
This entailed getting the data from the MySQL database into the Postgres database. I found the yaml_db .gem particularly useful here.
- run
rake db:data:dumpto create adb/data.ymlfile of all the data in your database - change database.yml to the new database's URL - something like
postgres://...amazonaws.com... - run
rake db:data:loadto load thedb/data.ymlfile into the Postgres database