Re: I need to load mysql dump to postgres...

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: unclebob <unclebob(at)localhost(dot)unclebob>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: I need to load mysql dump to postgres...
Date: 2011-10-12 04:50:26
Message-ID: 4E951C92.1060602@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/12/2011 10:37 AM, unclebob wrote:
> good noon,
> subj.
> I don't want to load dump to mysql etc...
> Is there a program which would just parse mysql dump file and load data
> to postgresql using plain sql inserts?

There's no single, simple automatic migration tool. Numerous tools exist
to help. See a simple Google search for "convert mysql postgresql", the
first result of which is:

http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL

For more complex jobs you may want to look at ETL tools like Pentaho or
Talend, but the nature of your question suggests it's probably a fairly
simple database.

It's often easiest to just hand-write the new schema, then do a
data-only MySQL dump in portable mode (with inserts) and run that
through psql.

Use mysqldump WITHOUT the "--all" or "-a" option so it doesn't dump as
much MySQL-specific stuff, and use "--no-create-db --no-create-info" to
suppress the schema definitions. Then edit out any remaining
MySQL-specific stuff and feed it into psql.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-10-12 04:52:11 Re: Drill-downs and OLAP type data
Previous Message Tom Lane 2011-10-12 04:49:44 link-spam (was Re: [GENERAL] 7)