Обсуждение: mysql 2 pg script...

Поиск
Список
Период
Сортировка

mysql 2 pg script...

От
andrew1
Дата:
hi all, I need to load mysql dump to postgre 8.3 . Is there a script to
do that? I hoped to use my2pg.pl , but couldn't find it.
It looks like it's not a part of /contrib in debian lenny.
what shoud I use for 8.3?

thanks.

Re: mysql 2 pg script...

От
Allan Kamau
Дата:
On Sat, Feb 19, 2011 at 5:03 AM, andrew1 <andrew1@mytrashmail.com> wrote:
> hi all, I need to load mysql dump to postgre 8.3 . Is there a script to do
> that? I hoped to use my2pg.pl , but couldn't find it.
> It looks like it's not a part of /contrib in debian lenny.
> what shoud I use for 8.3?
>
> thanks.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

This question may have been asked several times and received good
solutions in this mailing list, A search on this list may give you the
solution you need. I recall there is no one click/quick solution to
this migration as some objects may need rewriting and so on.

That said, I recall one of probable solutions would be to take a DDL
SQL dump of mySQL database objects then use a good editor to find and
replace characters that may not be found desirable by PostgreSQL.
Then take another SQL dump this time use the necessary switches to
output to the dump file data only in CSV or other simple format
excluding mysql specific statements. Then again you may need to run
you editor (hopefully sed) to find and replace or transform characters
and/or strings that may not be accepted by PostgreSQL.
You may want to start by outputting small table(s) first and see and
learn from the exercise. Always redirect standard output and standard
error to file during the imports so as to have a easier time debugging
the migration and ensure all is well.

Allan.

Re: mysql 2 pg script...

От
Andy Colson
Дата:
On 02/18/2011 08:03 PM, andrew1 wrote:
> hi all, I need to load mysql dump to postgre 8.3 . Is there a script to do that? I hoped to use my2pg.pl , but
couldn'tfind it. 
> It looks like it's not a part of /contrib in debian lenny.
> what shoud I use for 8.3?
>
> thanks.
>

I cannot convert the dump, but if you still have access to the mysql server I have a perl script that'll connect to it
anddump into a PG compatible format.  It wont generate create table statements, you'll have to do that yourself. 

I'll post it if you are interested.

-Andy

Re: mysql 2 pg script...

От
Devrim GÜNDÜZ
Дата:
On Fri, 2011-02-18 at 21:03 -0500, andrew1 wrote:
> I need to load mysql dump to postgre 8.3 . Is there a script to
> do that?

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

Regards,
--
Devrim GÜNDÜZ
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Вложения