7

I have a RAILS 3.x application developed locally using MySQL which has data which needs migrating. Now I want to deploy to Heroku, which uses Postgresql and also transfer the data.

The issue is in dealing with the columns with NULL data which the import process doesn't like.

I've attempted using a number of different strategies such as

  1. yaml_db gem - fails to import at all
  2. rails-backup-migrate gem - doesn't like the encoded NULL element;
  3. taps - fails on import without much detail

Has anyone tried any other strategies, gems or methods? Should I just start over with a Postgresl local DB instead ?

thanks in advance grant

4
  • not well versed in the problem, is there some way to use an intermediary like sqlite locally before pushing to heroku? Commented Nov 1, 2011 at 22:23
  • Yes - i've run the migrations to create the tables and this has the data populated from another legacy system. But just in case will re-check. Commented Nov 1, 2011 at 23:06
  • Yes - tried the heroku db:push which chugs along and then fails without too much help. Commented Nov 2, 2011 at 3:05
  • Heroku actually supports (by that I mean provides support for) taps. They wrote it. There may be a way to get more debug info out which they can help you with. We've done similar migrations successfully via taps. Commented Dec 24, 2011 at 6:21

2 Answers 2

2

Should I just start over with a Postgresl local DB instead ?

Heroku recommends that you use Postgres for local development.

Your production and development environment should be as close to identical as possible. This prevents difficult to diagnose bugs introduced by subtle differences between your environments. Every application on Heroku comes with a PostgreSQL database as the default SQL database. Therefore you should use PostgreSQL for your local development database as well. ( http://devcenter.heroku.com/articles/rails3 )

A quick search turned up this:

http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#MySQL

Good luck!

Sign up to request clarification or add additional context in comments.

Comments

0

I had this problem too and found this gem of a blog post.

It says you can use a gem called Valkyrie to migrate the data from a MySQL database to a PostgreSQL database. You just have to install the gem using gem install valkyrie and then use this command:

valkyrie mysql://datachomp@localhost/seppuku?password=QuickAndPainless postgres://[email protected]/seppuku 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.