PHPackages                             marcinkozak/databasemigrator - 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. marcinkozak/databasemigrator

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

marcinkozak/databasemigrator
============================

Tool to migrate from a database to another one.

0.2.0(6y ago)119MITPHPPHP &gt;=7.1

Since Sep 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/MarcinKozak/DatabaseMigrator)[ Packagist](https://packagist.org/packages/marcinkozak/databasemigrator)[ RSS](/packages/marcinkozak-databasemigrator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Database Migrator for Laravel
=============================

[](#database-migrator-for-laravel)

A simple console tool which helps to migrate database data from one to another using different DB connections.

### Features

[](#features)

- Defining source and target database connection.
- Allows to change target tables names and columns as well.
- Transforms data for each processing rows.

### When to use

[](#when-to-use)

Sometimes you can have an opportunity to make your custom database based on the existing one but in your opinion you can design it in better way for example primary keys are not names simply as `id` but in the `_id pattern`, or columns values are not exactly what you want.

### Installation

[](#installation)

Add `marcinkozak/databasemigrator` to `composer.json`.

```
"marcinkozak/databasemigrator": "dev-master"

```

Or simply run:

```
composer require marcinkozak/databasemigrator

```

To make it available for Laravel open the `config/app.php` file and add line below.

```
'providers' => array(

    // Other service providers entries

    MarcinKozak\DatabaseMigrator\DatabaseMigratorServiceProvider::class,
);
```

### Configuration

[](#configuration)

Run command

```
php artisan vendor:publish --provider="MarcinKozak\DatabaseMigrator\DatabaseMigratorServiceProvider"
```

to publish new files in an application root:

- `config/marcinkozak/databasemigrator/connections.php`
- `database/schemas/ExampleSchema.php`

The first file contains a collection of connections where each of them defines source and target DB connection, disabled/enabled state and class name of schema.

```
