PHPackages                             bogdananton/mysql-to-object-mapper - 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. bogdananton/mysql-to-object-mapper

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

bogdananton/mysql-to-object-mapper
==================================

MySQL-to-object-mapper outputs PHP objects from SQL dumps or servers

1.0.2(10y ago)220[4 issues](https://github.com/DeploymentTools/MySQL-to-object-mapper/issues)MITPHPPHP &gt;=5.4.0

Since Apr 5Pushed 10y agoCompare

[ Source](https://github.com/DeploymentTools/MySQL-to-object-mapper)[ Packagist](https://packagist.org/packages/bogdananton/mysql-to-object-mapper)[ RSS](/packages/bogdananton-mysql-to-object-mapper/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/b1b336a72db84eed7d72f5afc2ab5ec7aec3ae61777779cebb40212686362b98/68747470733a2f2f7472617669732d63692e6f72672f4465706c6f796d656e74546f6f6c732f4d7953514c2d746f2d6f626a6563742d6d61707065722e737667)](https://travis-ci.org/DeploymentTools/MySQL-to-object-mapper) [![Code Climate](https://camo.githubusercontent.com/352748a995cf33ae49c1e6bdb09a6ffc1b04f01d92a716e63238102a95fcbe0a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4465706c6f796d656e74546f6f6c732f4d7953514c2d746f2d6f626a6563742d6d61707065722f6261646765732f6770612e737667)](https://codeclimate.com/github/DeploymentTools/MySQL-to-object-mapper) [![Coverage Status](https://camo.githubusercontent.com/60111c0dd05c8933954803655908a70fc1e889d8d241f3e2cc8425ac118cf0b2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4465706c6f796d656e74546f6f6c732f4d7953514c2d746f2d6f626a6563742d6d61707065722f62616467652e737667)](https://coveralls.io/r/DeploymentTools/MySQL-to-object-mapper)

Scans MySQL structure and converts it into PHP objects. Using MySQL file dumps or a server as input.

Download the `phar` file from the [latest release page](https://github.com/DeploymentTools/MySQL-to-object-mapper/releases/latest).

### Commands:

[](#commands)

```
MySQL Extractor version 1.0.0

Usage:
  command [options] [arguments]

Available commands:
 snapshot
  snapshot:compare  Compares two snapshots and outputs the differences.
  snapshot:create   Scans a DB and outputs the structure.
 sync
  sync:compare      Compare two server DB instances and outputs their differences.
```

#### Snapshot create command:

[](#snapshot-create-command)

```
Usage:
  snapshot:create

Arguments:
  source  DB instance to be analysed. Format: USER:PASS@HOSTNAME[:PORT]/DATABASE or /PATH/TO/SQL/DUMPS/
  output  Output folder for the results file(s), where the database structure will be dumped in JSON format. Data will be stored in [databaseName]-[date]-[timestamp].json format.

Help:
 Scans a DB and outputs the structure.
```

Sample output:

```
{
    "Name": "redmine",
    "Tables": [
        {
            "Name": "attachments",
            "Fields": [
                {
                    "Id": "id",
                    "Type": "INT",
                    "Length": 11,
                    "Null": false,
                    "Default": 0,
                    "Comment": null,
                    "Autoincrement": true,
                    "Values": []
                },
                {
                    ...
                }
            ],
            "Keys": [
                {
                    "Column": "id"
                },
                {
                    ...
                },
                {
                    "Label": "index_attachments_on_container_id_and_container_type",
                    "Columns": [
                        "container_id",
                        "container_type"
                    ]
                }
            ]
        },
        {
            "Name": "auth_sources",
            "Fields": [
                ...
            ]
        }
    ]
}
```

#### Snapshot compare command:

[](#snapshot-compare-command)

```
Usage:
  snapshot:compare

Arguments:
  source       Path to the source DB snapshot (JSON file).
  destination  Path to the destination DB snapshot (JSON file)

Help:
 Compares two snapshots and outputs the differences.
```

Sample output:

```
{
    "table-diffs": {
        "attachments": {
            "field-diffs": {
                "container_type": {
                    "Type": {
                        "from": "VARCHAR",
                        "to": "INT"
                    }
                },
                "disk_filename": {
                    "Length": {
                        "from": 255,
                        "to": 500
                    },
                    "Null": {
                        "from": false,
                        "to": true
                    }
                }
            },
            "field-to-import": [
                {
                    "Id": "container_id",
                    "Type": "INT",
                    "Length": 11,
                    "Null": true,
                    "Default": 0,
                    "Comment": null,
                    "Autoincrement": false,
                    "Values": []
                }
            ],
            "field-to-delete": [
            ]
        }
    },
    "table-to-import": [],
    "table-to-delete": []
}
```

#### Sync compare command:

[](#sync-compare-command)

```
Usage:
  sync:compare

Arguments:
  source       Source server (main / trusted). Format: USER:PASS@HOSTNAME[:PORT]/DATABASE
  destination  Destination server. Format: USER:PASS@HOSTNAME[:PORT]/DATABASE

Help:
 Compare two server DB instances and outputs their differences.
```

The output is the same as with the Snapshot compare command.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

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 ~105 days

Total

3

Last Release

3898d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c23542102f1a99ba5636aca4979cc5552cd382727384d011c2a36f6663c44aa?d=identicon)[bogdananton](/maintainers/bogdananton)

---

Top Contributors

[![bogdananton](https://avatars.githubusercontent.com/u/1594303?v=4)](https://github.com/bogdananton "bogdananton (44 commits)")

### Embed Badge

![Health badge](/badges/bogdananton-mysql-to-object-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/bogdananton-mysql-to-object-mapper/health.svg)](https://phpackages.com/packages/bogdananton-mysql-to-object-mapper)
```

###  Alternatives

[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

2411.8k](/packages/perplorm-perpl)

PHPackages © 2026

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