From:       To:      
Home > Documentation > PostgreSQL to MySQL

PostgreSQL to MySQL Tutorial

1. Welcome Screen

On this screen you need to select the conversion scenario. MySQL to PostgreSQL converter provides two options to convert MySQL database into PostgreSQL data source:

  • Move to MySQL server directly - use this approach to migrate PostgreSQL database to the target MySQL server directly. It requires PostgreSQL server launched and necessary privileges to write into database on the target server. See Connect to MySQL Server section for related information.
  • Store into dump file - this option allows to export the data into a local script file instead of moving it to MySQL server. The file contains MySQL statements to create all tables and to fill them with the data. See Import MySQL script files article for related information.
    

2. Connect to PostgreSQL Server

PostgreSQL to MySQL database migration tool can connect to PostgreSQL server in either local or remote mode. Local mode is used to connect to the server launched on the same machine where the converter is running. Remote mode allows to connect to PostgreSQL server launched on another computer.

By default, the conversion tool uses local connection mode. It is indicated by radio button "Local" selected. To establish remote connection, select "Remote" radio button. This option also requires specifying host and port to connect through. Host could be either network name or IP address of the PostgreSQL server. The port value is necessary only if it differs from the default PostgreSQL port number 5432. Otherwise, leave this field as is.

Then user name and password for valid PostgreSQL account must be specified.

    

3. Connect to MySQL Server

PostgreSQL to MySQL converter can connect to MySQL server via either local or remote mode. Local mode is designed to connect MySQL server launched on the same machine where PostgreSQL to MySQL tool is running. Remote mode allows to connect to MySQL server launched on another computer.

By default, the program uses local connection mode. It is indicated by radio button "Local" selected. To establish remote connection you should select "Remote" radio button. For remote MySQL servers you should also enter host and TCP/IP port to connect through. Host could be either network name or IP address. TCP/IP port value is necessary only if it differs from the default MySQL port number 3306. Otherwise you may leave this field as is.

Finally, you are entering user name and password. You can leave these fields empty for anonymous connection.

    

4. Select Databases

On this wizard screen PostgreSQL and MySQL databases must be specified. If destination database already exists, the program gives multiple options how to process it:

  • overwrite the entire database
  • overwrite existing tables only
  • skip existing tables
  • merge
  • synchronize

PostgreSQL to MySQL database migration tool implements synchronization as insert of records missing in the target table and update of existing MySQL records with PostgreSQL data. Source and destination tables must have identical structures and define primary key or unique index for synchronization purpose.

    
Also, you can specify log file to write execution traces of the conversion process. Leave this field blank to disable logging.

Customize Conversion Settings

On this wizard screen you can specify PostgreSQL schema (drop down the combo box to select from list or enter it manually) and customize the conversion process using the following settings:

  • Convert table definitions only - select this checkbox to convert only table definitions of the original PostgreSQL database
  • Skip converting indexes - select this checkbox if you don't want to convert indexes
  • Do not include schema name - select this checkbox to not include schema name in table names. By default, this option is NOT active in order to process tables with same names from different schemas.

Note: leave schema name blank to convert tables from all schemas.

    

5. Select Tables

On this wizard screen you can manage the list of PostgreSQL tables for conversion. In the left part of PostgreSQL to MySQL tool's window there is "Available tables" list box. It contains all available tables of the source database except those that have been selected already. On the right side there is "Selected tables" list box.

To add new PostgreSQL table for converting into MySQL format you select the appropriate item in "Available tables" list box and click "Add" button (or double-click the selected item). Also you can use "Add all" button to insert all available PostgreSQL tables.

To remove an item from "Selected tables" list you should select it and click "Remove" button. You can use "Remove all" button to remove all items from "Selected tables" list box.