Re: Mysql to Postgresql

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Mysql to Postgresql
Date: 2011-02-23 03:33:13
Message-ID: 4D647FF9.5050009@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/22/11 1:25 AM, Jaime Crespo Rincón wrote:
> 2011/2/22 Adarsh Sharma<adarsh(dot)sharma(at)orkash(dot)com>:
>> Dear all,
>>
>> Today I need to back up a mysql database and restore in Postgresql database
>> but I don't know how to achieve this accurately.
> Have a look at: "mysqldump --compatible=postgresql" command:
> <http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_compatible>
>
> Anyway, most of the times you will need a more manual migration, with
> human intervention (custom scripts) and migrating the data through
> something like CSV (SELECT... INTO OUTFILE).

if your tables aren't too huge, one method is via a perl script that
uses DBI to connect to both mysql and pgsql, and fetches a table from
one and loads it into the other. the catch-22 is, its fairly hard to
do this efficiently if the tables won't fit in memory

there are also various "ETL" (Extract, Translate, Load) tools that do
this sort of thing with varying levels of performance and automation,
some free, some commercial.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mezgani ali 2011-02-23 03:54:10 Re: Mysql to Postgresql
Previous Message Rich Shepard 2011-02-23 02:58:40 Re: Finding Errors in .csv Input Data