Netzwelt MySQL to PostgreSQL
If you want to convert from MySQL to PostgreSQL, use the following command to have mysqldump spit out sane SQL:
% mysqldump $DATABASE_NAME -v -nt --compatible=ansi,postgresql --complete-insert=TRUE --extended-insert=FALSE --compact --default-character-set=UTF8 -u $DATABASE_USER -p -r $OUTPUT_FILE
You should then hoopefully be able to load this dump into your PostgreSQL database using
=> \i $OUTPUT_FILE
from within psql.
This piece of information is hidden deeply within the net! It is not clearly written in the mysqldump docs. There are lots of Google results for “MySQL to PostgreSQL” but most of them are needlessly silly and of doubting quality. Spread this info!
Converting the database schema cannot be handled by witty mysqldump switches and is left as an exercise to the reader.
Once you get the database schema. You might want to exclude complete-inserts=TRUE because if you it could give table param names with mixed cases. In some version PostgreSQL it converts mixed case params schema to lowercase. Which could cause and error with importing. thanks….
by Anonymous
2008, November 14 (Fri)@ 15:04
Thanks, was really usefull :-)