From:       To:      
Home > Documentation > DB2 to PostgreSQL

DB2 to PostgreSQL Tutorial

[DB2 to PostgreSQL Converter]  [Introduction to Migration]  [Command line]

The process of database migration from IBM DB2 to PostgreSQL consists of the following steps:

Step 1 of 4. Connect to DB2 Server

On this wizard screen you should enter the necessary settings to establish connection to DB2 server.

  • Database - name (or alias-name) of the data source as you use it with IBM DB2 common tools
  • Username - DB2 username for the data source to which you are connecting
  • Password - DB2 password for the data source to which you are connecting

Step 2 of 4. Connect to PostgreSQL Server

This wizard screen collects information to connect to PostgreSQL server. DB2-to-PostgreSQL converter is able to connect to both local and remote PostgreSQL servers.

By default the program uses local connection mode. It is indicated by radio button "Local" selected. To remote connection select "Remote" radio button, specify the host (network name or IP address) and the port. The port value is necessary only if it differs from the default PostgreSQL port number 5432. Otherwise you may leave this field as is.

Enter user name and password or leave these fields blank for anonymous connection.

By default PostgreSQL server connects to database with name equal to the username specified. If there is no such database or PostgreSQL server does not allows access to it, custom database may be specifies on this wizard page.

Step 3 of 4. Conversion Settings

On this wizard screen you should enter DB2 schema name and the destination PostgreSQL database. Also, you can customize the conversion process using the following settings:
  • Convert table definitions only - select this checkbox to convert only table definitions of the original DB2 database
  • Skip converting indexes - select this checkbox to if you don't want to convert indexes select

If you specify the name of existing PostgreSQL database, you will be able to select how to process it:

  • Overwrite the entire database
  • Overwrite existing tables only
  • Skip existing tables
  • Merge

Step 4 of 4. Select Tables

This wizard page is designed to manage the list of tables to migrate from IBM DB to PostgreSQL.

To add new table for converting it into PostgreSQL format, select it in "Available tables" list box and click "Add" button (or double-click the selected item). Use "Add all" button to add all available tables.

To remove an item from "Selected tables" list highlight it and click "Remove" button. Use "Remove all" button to remove all items from "Selected tables" list box.

Push "Add Query" button to add SELECT-query filtering data that will be migrated to PostgreSQL. See Using Queries article for the further information.