TheDragonCode/
migrate-db
g4t.io

Migrate One Database to Another in a Laravel Project

17 views 155 stars by Paul Redmond

Easy data transfer from one database to another

database migration migration-tool migrations mssql mysql pgsql
README from TheDragonCode/migrate-db Open on GitHub →

Migrate DB for Laravel

Stable Version Total Downloads 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

Service Versions
PHP ^8.0
Laravel ^8.0, ^9.0, ^10.0, ^11.0, ^12.0, ^13.0
Databases MySQL 5.7+, PostgreSQL 9.5+, MSSQL
Laravel \ PostgreSQL 9 10 11 12 13 14 15 16 17 18
8 ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
9 ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
10 ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
11 ✖️ ✖️ ✖️ ✅ ✅ ✅ ✅ ✅ ✅ ✅
12 ✖️ ✖️ ✖️ ✅ ✅ ✅ ✅ ✅ ✅ ✅
13 ✖️ ✖️ ✖️ ✅ ✅ ✅ ✅ ✅ ✅ ✅

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

For Certain Tables

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

Exclude Certain Tables

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

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.

More from the ecosystem

durable-workflow/
workflow
g4t.io
9 1,292

Durable Workflow: Long-Running Workflows for Laravel

Embedded durable workflow runtime and orchestration engine for Laravel applications.

durable-workflow/workflow via Laravel News
packstub/
session-replay
g4t.io
14 52

Session Replay for Laravel: Self-Hosted Browser Recordings

Session replay for Laravel: record what a person did in the browser with rrweb, keep the recording on your own disk and database, and watch it behind a gate you define — masked inputs by default, errors, failed Livewire requests and web vitals marked on the timeline, a link to the replay in every log line. packstub/filament-session-replay adds the sessions to a Filament panel.

packstub/session-replay via Laravel News
cyberwizard-dev/
schedule-catchup
g4t.io
17

Replay Missed Laravel Scheduled Tasks With Schedule Catchup

Schedule Catchup replays missed Laravel scheduled tasks after downtime, with opt-in recovery, bounded retries, and access to the original scheduled date.

cyberwizard-dev/schedule-catchup via Laravel News