Video
Description
Easy data transfer from one database to another
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:
foo- Source connection namebar- Target connection name
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.
Related Content on Laravel Daily
Video
Recent Courses on Laravel Daily
Next.js Basics for Laravel Developers
11 lessons
58 min
Testing in Laravel 13 For Beginners
26 lessons
1 h 41 min read
Laravel 13 Eloquent: Expert Level
41 lessons
1 h 34 min