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?
-
Are you tried to use --compatible=name command line argument?Maxim– Maxim2015-02-28 20:12:40 +00:00Commented 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.Dawid– Dawid2015-02-28 20:16:48 +00:00Commented Feb 28, 2015 at 20:16
Add a comment
|
2 Answers
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?
Comments
Try to use mysql2postgres. I have used it more than 5 years ago but seems like it supported yet.