Import MySQL dump to PostgreSQL database

后端 未结 17 850
北海茫月
北海茫月 2020-12-04 10:05

How can I import an \"xxxx.sql\" dump from MySQL to a PostgreSQL database?

17条回答
  •  死守一世寂寞
    2020-12-04 10:10

    The fastest (and most complete) way I found was to use Kettle. This will also generate the needed tables, convert the indexes and everything else. The mysqldump compatibility argument does not work.

    The steps:

    1. Download Pentaho ETL from http://kettle.pentaho.org/ (community version)

    2. Unzip and run Pentaho (spoon.sh/spoon.bat depending on unix/windows)

    3. Create a new job

    4. Create a database connection for the MySQL source (Tools -> Wizard -> Create database connection)

    5. Create a database connection for the PostgreSQL source (as above)

    6. Run the Copy Tables wizard (Tools -> Wizard -> Copy Tables)

    7. Run the job

提交回复
热议问题