# Nuby migration question -- data migration, MySQL =\> postgres

**URL:** <https://www.ruby-forum.com/t/nuby-migration-question-data-migration-mysql-postgres/94441>\
**Category:** Rails\
**Created:** [May 3, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/nuby-migration-question-data-migration-mysql-postgres/94441 "2006-05-03T19:09:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wksmall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@wksmall](https://www.ruby-forum.com/u/wksmall)\
**Post date:** [May 3, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/nuby-migration-question-data-migration-mysql-postgres/94441/1 "2006-05-03T19:09:42Z")

</div>

How do I best migrate the data? For small databases I can text-edit the  
dump file from  
MySQL. The postgresql compatibility switch doesn’t help on mysqldump.  
Any ideas. Can  
MySQL export CSV that postgresql can import ?

W Fred

---

<div class="post-metadata">

**Author:** ![wksmall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@wksmall](https://www.ruby-forum.com/u/wksmall)\
**Post date:** [May 3, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/nuby-migration-question-data-migration-mysql-postgres/94441/2 "2006-05-03T19:10:37Z")

</div>

On Apr 29, 2006, at 1:42 PM, Warren S. wrote:

> How do I best migrate the data? For small databases I can text-  
> edit the dump file from MySQL. The postgresql compatibility switch  
> doesn’t help on mysqldump. Any ideas. Can MySQL export CSV that  
> postgresql can import ?

Yes, PostgreSQL can import a CSV. 🙂

I’ve also worked on a rake task in the past that would talk to a  
MySQL db (Rails app) and then after I generate the PostgreSQL db with  
the same schema (with the different field types)… I would just run  
rake mysql2pgsql and it’d go through a yaml → model → save process.  
It worked pretty well on a few projects.

Email me off list and I’ll see what I can dig up this week for you.

-Robby

Robby R.  
Founder & Executive Director

PLANET ARGON, LLC  
Ruby on Rails Development, Consulting & Hosting

> **[Planet Argon](https://www.planetargon.com)**
>
> Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.

[www.robbyonrails.com](http://www.robbyonrails.com)

+1 503 445 2457  
+1 877 55 ARGON [toll free]  
+1 815 642 4968 [fax]

---

<div class="post-metadata">

**Author:** ![wksmall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@wksmall](https://www.ruby-forum.com/u/wksmall)\
**Post date:** [May 3, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/nuby-migration-question-data-migration-mysql-postgres/94441/3 "2006-05-03T19:10:40Z")

</div>

On Apr 29, 2006, at 6:53 PM, Robby R. wrote:

> I’ve also worked on a rake task in the past that would talk to a  
> MySQL db (Rails app) and then after I generate the PostgreSQL db  
> with the same schema (with the different field types)… I would  
> just run rake mysql2pgsql and it’d go through a yaml → model →   
> save process. It worked pretty well on a few projects.
> 
> Email me off list and I’ll see what I can dig up this week for you.

Also, there is this project:

[http://gborg.postgresql.org/project/mysql2psql/projdisplay.php](http://gborg.postgresql.org/project/mysql2psql/projdisplay.php)

Cheers,

Robby

Robby R.  
Founder & Executive Director

PLANET ARGON, LLC  
Ruby on Rails Development, Consulting & Hosting

> **[Planet Argon](https://www.planetargon.com)**
>
> Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.

[www.robbyonrails.com](http://www.robbyonrails.com)

+1 503 445 2457  
+1 877 55 ARGON [toll free]  
+1 815 642 4968 [fax]
