Categories Database

MySQL to PostgreSQL: introduction to database migration

 

Open-source database management systems are the long-term trend in modern IT. Organizations often chose these DBMS in order to reduce total cost of ownership. MySQL and PostgreSQL are the most powerful open-source systems enrichedby wide collections of programming frameworks and administration tools. 

While both are equivalent in many aspects, there are multiple reasons to prefer PostgreSQL over MySQL: full compliance with the ANSI SQL standard, wide variety of indexing models, asynchronous commit, flexibleoptions of replication and many others.

In view of those benefits specialists often decide to migrate their databases from MySQL to PostgreSQL. The most straight forward way of migration includes following steps:

  1. MySQL table definitions, indexes and constraints are extracted in form of SQL CREATE-statements
  2. Before loading to PostgreSQL, these statements are converted into the target format
  3. MySQL data is exported into intermediate storage using CSV files
  4. The data from CSV files is transformed according to PostgreSQLformat and loaded into destination tables
  5. MySQL views, triggers and stored procedures are extracted in form of SQL statements and the source code
  6. Before loading to the PostgreSQL, all extracted statements and codeare converted into the target format

The steps listed above are necessary for database migrationMySQL to PostgreSQL and it is obviously takes lot of efforts when doing manually. The human factor leads to high risk of losing data integrity or database logics, especially for complicated corporate-scale warehouses. The conversion from MySQL to PostgreSQL should be automated usingdedicated software tools.

When choosing the right conversion utility, it is important to recognize what are the key features required for such tools. Here are the most important requirements for advanced database migration software: 

  • Do not use of middleware libraries or components for reading or writing of data since it can reduce the product performance
  • Support all modern versions of MySQL and PostgreSQL includingsuchvariations and cloud instances as MariaDB, Percona, Heroku and Amazon RDS
  • Option to change name, type and other attributes of every table column during migration process as well as exclude particular columns from migration
  • Option to automate and schedule database conversion by support of command line parameters
  • Option to merge and synchronize existing PostgreSQL database with MySQL data

MySQL to PostgreSQL converter is one of tools meeting all the requirements listed above. It has been developed by Intelligent Converters, software vendor specializing in database migration since 2001. 

Moreover, the product has powerful feature – converting data that is result of user-defined SELECT queries. This option allows to filter data, to apply some preprocessing through built-in functions, to combine multiple tables into single one and many others.

About Author