Leonardo Dario Perna
Leonardo Dario Perna

Reputation: 1045

How to migrate from SQLite to PostgreSQL (Rails)

I'm a DB noob so please be kind with me.

I'm having some issues pushing my SQLite DB to Heroku via taps gem. Talking with them, they told me one of the solutions could be converting locally my DB from SQLite to PostgreSQL. Is there an easy way to do so?

Thanks

More info: - DB from Rails app - I'm on Mac OS X - Just installed PostgreSQL via macports

Upvotes: 18

Views: 12451

Answers (2)

Mikhail Chuprynski
Mikhail Chuprynski

Reputation: 2493

Sequel will help you

gem install sequel

sequel -C sqlite://db/development.sqlite3 postgres://username:password@localhost/dbname

Upvotes: 8

jxpx777
jxpx777

Reputation: 3641

sqlite3 development.db .dump | psql dbname username

Upvotes: 20

Related Questions