0

Hi I got a MySQL database dump, it's a sql file. Is there a way to import it to Postgres database using ruby? I know that there is a command like ActiveRecord::Base.connection.execute(IO.read("path/to/file")) but it fails, because of different databases. The main problem is to convert somehow sql file, to be a Postres format. Is it even possible using only Ruby On Rails?

2
  • Are you tried to use --compatible=name command line argument? Commented Feb 28, 2015 at 20:12
  • The problem is that I didn't even create this dump. I just got a sql file which I need to import to postgres database. I don't have acces to MySQL database. Commented Feb 28, 2015 at 20:16

2 Answers 2

0

Have you checked out pgloader? http://pgloader.io/ It's really easy to use and has helped me lots.

Or I'll refer to this question; How to import existing *.sql files in PostgreSQL 8.4?

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

Comments

0

Try to use mysql2postgres. I have used it more than 5 years ago but seems like it supported yet.

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.