how to copy data from mysql to postgres?

109 views
Skip to first unread message

Fahim Patel

unread,
Jan 14, 2013, 7:06:43 AM1/14/13
to rubyonra...@googlegroups.com

Hi all,

Is there any gem to copy data from mysql to postgres ?
I search lot  but i didn't get any thing .

Thanks 
Fahim

Jordon Bedwell

unread,
Jan 14, 2013, 7:12:48 AM1/14/13
to rubyonra...@googlegroups.com
On Mon, Jan 14, 2013 at 6:06 AM, Fahim Patel <paf...@gmail.com> wrote:
> Is there any gem to copy data from mysql to postgres ?
> I search lot but i didn't get any thing .

You're gonna have to figure that one out yourself by using 2 models
and some clever trickery, or you might be able to dump the data and
import into postgres if it's generic enough with little effort but I
would much rather go the 2 model route even if it takes far more time.

Fahim Patel

unread,
Jan 14, 2013, 7:21:57 AM1/14/13
to rubyonra...@googlegroups.com
Thanks lot for reply.
Few months ago i have studied about one gem which do this work, but i forget the name.
Did any one know about this ?

Colin Law

unread,
Jan 14, 2013, 7:38:20 AM1/14/13
to rubyonra...@googlegroups.com
On 14 January 2013 12:06, Fahim Patel <paf...@gmail.com> wrote:
>
> Hi all,
>
> Is there any gem to copy data from mysql to postgres ?
> I search lot but i didn't get any thing .

http://en.wikibooks.org/wiki/Converting_MySQL_to_PostgreSQL describes
how to do a dump from mysql and restore to postgres but I don't see
any advantage of using a gem over that technique.

Colin

Rodrigo Mendonça

unread,
Jan 14, 2013, 7:49:17 AM1/14/13
to rubyonra...@googlegroups.com
use gem taps

2013/1/14 Colin Law <cla...@googlemail.com>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.



--
Rodrigo Mendonça
(62) 8567-3142

Fahim Patel

unread,
Jan 14, 2013, 8:19:39 AM1/14/13
to rubyonra...@googlegroups.com
Thanks lot for reply.

Fahim

Walter Lee Davis

unread,
Jan 14, 2013, 10:22:03 AM1/14/13
to rubyonra...@googlegroups.com
I really like yaml_db for this. I have only used it for SQLite to MySQL and MySQL to MySQL, but it works smoothly and quickly, and in my case, did not flinch at 2M records in a table.

Walter
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/a7BZJWbsdq8J.

akalyaev

unread,
Jan 15, 2013, 4:18:19 AM1/15/13
to rubyonra...@googlegroups.com
I would like to add: if you have some custom mapping between the models, you could write a simple rake task. Example: http://myutil.com/2008/8/31/rake-task-transfer-rails-database-mysql-to-postgres

Regards,
Anton
Reply all
Reply to author
Forward
0 new messages