Re: [ADMIN] mysql to pgsql

From: "Nikolay Mijaylov" <nmmm(at)nmmm(dot)nu>
To: "Bob Zoller" <bob(at)helpermonkey(dot)org>, <pgsql-admin(at)postgreSQL(dot)org>
Subject: Re: [ADMIN] mysql to pgsql
Date: 2000-02-18 09:23:49
Message-ID: 000e01bf79f1$dee08ac0$ce2a18c3@skillbrokers.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hya

1. Dump data from Mysql
mysqldump > x
2. Open x
joe x (or vi x)
Look tables create data, fix types (such int(11) -> integer,
etc)
Remove all Mysql comments, unfortunately pg, cant support
comments,
they begins with # if i not mistake
Quote some data if need - tablenames, field names etc such
(create table "order" etc)
Remove Mysql quotes if any.
Look encoding - such \" (i suggest pg and mysql encoding is
same, so only check it)
(all this is done with search replace)
2. Save file
3. Create new db in postgre,
4. psql the_db_name < x
5. Look errors. If any return to point 2

thats all.

Second "easy" way is to use database migrate utility under windows, with two
ODBC configured to two servers. If you do so, dump pg database after this,
check types, then drop it and import again (this is because ODBC substitute
wrong types eg int -> float for example)

After migration, dont forget to grant rights on the new database, because
they will be not transfered.

if you hava a problem, just tell me.
nmmm
--------------------------------------------------------------
The reboots are for hardware upgrades!
"http://www.nmmm.nu; <nmmm(at)nmmm(dot)nu>

----- Original Message -----
From: Bob Zoller <bob(at)helpermonkey(dot)org>
To: <pgsql-admin(at)postgreSQL(dot)org>
Sent: ÷åòâúâòúê, Ôåâðóàðè 17, 2000 11:19
Subject: [ADMIN] mysql to pgsql

> I'm trying to make the switch from mysql to pgsql, but I'm having trouble
> figuring out how to transfer my databases over! I tried doing a dump in
> mysql and then importing that into pgsql, but I got *tons* of errors.. I
> searched the list archives and docs, but I haven't found anything that
> talks about this..
>
> Does anyone know how I can move my databases over?
>
> Thanks,
> --Bob
>
>
> ************

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sameer Anja 2000-02-18 10:04:49 Backend error with postgres 6.5.3 on redhat 6.1
Previous Message SAI SIU 2000-02-18 03:19:49 Initdb problem in red Hat 6.0