MySQL to PostgreSQL – Database Migration

MySQL to PostgreSQL – Database Migration

- in Tech
415
Comments Off on MySQL to PostgreSQL – Database Migration
Untitled

When it comes to open source RDBMS, both PostgreSQL and MySQL are extremely popular as they boast a wide array of administration tools as well as programming APIs. However, PostgreSQL is widely seen to have key benefits over MySQL including the following;

  • it supports asynchronous and synchronous replication
  • it supports many different models of indexing
  • provides asynchronous commit
  • it fully complies with the ANSI SQL standard

As a result of these differences, many businesses are choosing MySQL to PostgreSQL migration. If you were to carry out this process, it would involve the following;

  • Using the source database (DDL SQL statements) to extract table definitions
  • Converting the statements into the correct format in order to load them into the new database
  • Using the source database to export the data into an intermediate storage such as csv files
  • Depending on the new format, transforming the data to then be loaded into the Postgres database
  • Using the MySQL database to extract views, triggers, and stored procedures (SQL statements and source code)
  • Finally, these statements and source code must then be converted to the correct format and loaded into the new PostgreSQL database

As you can see, doing this process manually does take a little effort and there is also a huge amount of risk that data will be lost or become corrupt due to human error. When converting, it is advised that special software is used in order to minimise this risk and compete the process safely.

Developed by Intelligent Converters, ‘MySQL to PostgreSQL’ is one of the most popular conversion tools since it includes direct reading and writing of data without having to use middleware libraries or components. The company itself, Intelligent Converters, is a software vendor specialist who focus their attentions on database conversion and migration and have been doing so since the turn of the millennium. Furthermore, the program works for cloud solutions and all other versions of both MySQL and PostgreSQL. In order to automate and schedule database conversion, command line version is also used. Not only can MySQL data be migrated into a new database using this superb program, it can also be synchronized and merged if one has an existing PostgreSQL database.

In addition to this, there are many different options depending on what you need to achieve. If you only need to move certain records across to the new database, this can also be done thanks to the ‘Select’ queries. When this option is chosen, individual columns and records can be selected and they can even be transformed before then converting it to the new format.

At times, you will need to use the ‘custom column mapping’ tool and this allows you to change column type in the new database. As a simple dialog window, the name, value, type, and NULL-attribute can be edited. Finally, the program also allows for exporting into SQL script if the PostgreSQL server doesn’t allow remote connection. Firstly, the source database will be exported to create tables with indexes and constraints to then be filled with data. When this is done, the administrator can use the PostgreSQL server to import the script file using pgAdmin or psql.

About the author