"FromMySqlToPostgreSql" - the database migration tool.
FromMySqlToPostgreSql is a tool, intended to make a process of migration from MySql to PostgreSql as easy and smooth as possible.
Important update!
Recently I've developed NMIG, a database migration app, written in Node.js, and highly inspired by FromMySqlToPostgreSql.
NMIG has important functional enhancements.
Due to Node.js asynchronous nature, NMIG executes a part of its tasks in parallel, what makes it up to 3 times faster than FromMySqlToPostgreSql. Visit https://github.com/AnatolyUss/nmig.
However, if you're not into Node.js, you can still use old and proven FromMySqlToPostgreSql.
1. Create a new database.
Sample:CREATE DATABASE my_postgresql_database;
2. Download FromMySqlToPostgreSql package and put it on the machine running
your PostgreSql.
Sample: /path/to/FromMySqlToPostgreSql
3. Create configuration file in either "xml" or "json" format and put it on
the machine running your PostgreSql.
Sample: /path/to/FromMySqlToPostgreSql/config.json
or /path/to/FromMySqlToPostgreSql/config.xml
Remarks:
4. Run the script from a terminal.
Sample:
php /path/to/FromMySqlToPostgreSql/index.php /path/to/FromMySqlToPostgreSql/config[.xml | .json]
5. At the end of migration check log files, if necessary.
Log files will be located in "logs_directory" folder in the root of the package.
Note: "logs_directory" will be created during script execution.
6. In case of any remarks, misunderstandings or errors during migration,
please feel free to email me
[email protected]
Current version is 1.5.0
(major version . improvements . bug fixes)
The tests/ folder contains SQL files that exercise the migration tool to ensure it can
process different types of input structures correctly. To use these files you must
setup a mysql server with them. An example might be mysql < tests/foreign_key.sql
.
You can then follow the use the USAGE section to create a migration script it runs without error.
If you wish to add further tests to verify issues that are fixed, just add another SQL file
and future developers will be able to confirm that changes don't cause any regressions.
Tested using MariaDB 10 and PostgreSql (9.6).
The entire process of migration 33 GB database (90 tables, approximately 72 million rows),
which includes data types mapping, creation of tables, constraints, indexes,
PKs, FKs, migration of data, garbage-collection and analyzing the newly created
PostgreSql database took 54 minutes.
FromMySqlToPostgreSql is available under "GNU GENERAL PUBLIC LICENSE" (v. 3)
http://www.gnu.org/licenses/gpl.txt.
Errors/Exceptions are not passed silently.
Any error will be immediately written into the error log file.
Big thanks to all contributors for their valuable remarks!