PHPackages                             jumper423/migration-mysql-to-postgresql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jumper423/migration-mysql-to-postgresql

ActiveProject[Database &amp; ORM](/categories/database)

jumper423/migration-mysql-to-postgresql
=======================================

Миграция из Mysql в PostgreSql

1.2(10y ago)140Apache License 2.0PHPPHP &gt;=5.4.0

Since Jun 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jumper423/migration-mysql-to-postgresql)[ Packagist](https://packagist.org/packages/jumper423/migration-mysql-to-postgresql)[ Docs](https://github.com/jumper423/migration-mysql-to-postgresql)[ RSS](/packages/jumper423-migration-mysql-to-postgresql/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

### FromMySqlToPostgreSql - the database migration tool.

[](#frommysqltopostgresql---the-database-migration-tool)

### WHAT IS IT ALL ABOUT?

[](#what-is-it-all-about)

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](https://github.com/AnatolyUss/nmig), a database migration app, written in Node.js, and highly inspired by FromMySqlToPostgreSql.
[NMIG](https://github.com/AnatolyUss/nmig) has a few important functional enhancements.
Due to Node.js asynchronous nature, [NMIG](https://github.com/AnatolyUss/nmig) executes a part of its tasks in parallel, what makes it up to 3 times faster than FromMySqlToPostgreSql. Visit .
However, if you're not into Node.js, you can still use old and proven FromMySqlToPostgreSql.

### KEY FEATURES

[](#key-features)

- Ease of use - the only thing needed to run this script is the PHP(CLI) interpreter.
- Accuracy of migration the database structure - FromMySqlToPostgreSql converts MySql data types to corresponding PostgreSql data types, creates constraints, indexes, primary and foreign keys exactly as they were before migration.
- Ability to migrate big databases - in order to reduce RAM consumption
     FromMySqlToPostgreSql will split each table's data into several chunks.
    The chunk size can be adjusted easily via configuration file.
- Speed of data transfer - in order to migrate data fast
     FromMySqlToPostgreSql uses PostgreSQL COPY protocol.
     Note: migration of tables, containing "varbinary" or "blob" columns may be considerably slower.
- Ease of monitoring - FromMySqlToPostgreSql will provide detailed output about every step, it takes during the execution.
- Ease of configuration - all the parameters required for migration should be put in one single file, which can be in either "xml" or "json" format.
- Ability to transfer only a data (in case of an existing database).

### SYSTEM REQUIREMENTS

[](#system-requirements)

- **PHP (CLI) 5.4** or above
- **PDO\_MYSQL** should be installed and enabled
- **PDO\_PGSQL** should be installed and enabled
- **mbstring** should be installed and enabled
- **register\_argc\_argv** should be enabled (check php.ini).

### USAGE

[](#usage)

**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

**4.** Run the script from a terminal.
 **Sample:** `   php index.php `

**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 [anatolyuss@gmail.com](mailto:anatolyuss@gmail.com?subject=FromMySqlToPostgreSql)

### VERSION

[](#version)

Current version is 1.4.0
(major version . improvements . bug fixes)

### TEST

[](#test)

Tested using MySql Community Server (5.6.21) and PostgreSql (9.3).
The entire process of migration 59.6 MB database (49 tables, 570750 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 3 minutes 6 seconds.

Tested using MySql Community Server (5.6.21) and PostgreSql (9.4).
The entire process of migration 3.1 GB database (56 tables, 8732967 rows),
 with the same steps as above, took 2 hours and 10 minutes.

### REMARKS

[](#remarks)

Errors/Exceptions are not passed silently.
 Any error will be immediately written into the error log file.

### ACKNOWLEDGEMENTS

[](#acknowledgements)

Big thanks to all contributors for their valuable remarks!

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3680d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12099016?v=4)[Vlad Pasechnik](/maintainers/jumper423)[@jumper423](https://github.com/jumper423)

---

Top Contributors

[![jumper423](https://avatars.githubusercontent.com/u/12099016?v=4)](https://github.com/jumper423 "jumper423 (5 commits)")

---

Tags

mysqlpostgresqlМиграция

### Embed Badge

![Health badge](/badges/jumper423-migration-mysql-to-postgresql/health.svg)

```
[![Health](https://phpackages.com/badges/jumper423-migration-mysql-to-postgresql/health.svg)](https://phpackages.com/packages/jumper423-migration-mysql-to-postgresql)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k595.8M6.5k](/packages/doctrine-dbal)[catfan/medoo

The lightweight PHP database framework to accelerate development

4.9k1.5M203](/packages/catfan-medoo)[malkusch/lock

Mutex library for exclusive code execution.

9479.9M28](/packages/malkusch-lock)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58825.2M48](/packages/scienta-doctrine-json-functions)[dunglas/doctrine-json-odm

An object document mapper for Doctrine ORM using JSON types of modern RDBMS.

6305.3M12](/packages/dunglas-doctrine-json-odm)[nette/database

💾 Nette Database: layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.

5436.9M255](/packages/nette-database)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
