dragon-code/migrate-db

Easy data transfer from one database to another

3.2.0 2024-03-15 00:04 UTC

README

Migrate DB

Stable Version Total Downloads Github Workflow Status License

Easy data transfer from one database to another

Installation

To get the latest version of Migrate DB, simply require the project using Composer:

composer require dragon-code/migrate-db --dev

Or manually update require-dev block of composer.json and run composer update.

{
    "require-dev": {
        "dragon-code/migrate-db": "^3.0"
    }
}

Compatibility

Usage

Create a new database and set up both connections in the connections section of the config/database.php file, then run the db:migrate console command passing two parameters:

php artisan db:migrate --schema-from=foo --schema-to=bar

Only Specific Tables

php artisan db:migrate --schema-from=foo --schema-to=bar --tables=table1 --tables=table2 --tables=table3

Exclude Specific Tables

php artisan db:migrate --schema-from=foo --schema-to=bar --exclude=table1 --exclude=table2 --exclude=table3

where:

Follow on screen instructions and then command will perform all migrations on the source and destination databases and transfer all records from the old to the new one.

Enjoy 😊

License

This package is licensed under the MIT License.