Migrating from MySQL to PostgreSQL
release
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
By Ryan Wold · © 2015–2026 Ryan Wold
Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.
Enjoyed this? — any BSV wallet, HandCash, or plain old dollars.