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
Laravel 13 Starter Kit Teams and Customizations
10 lessons
33 min
Testing in Laravel 13 For Beginners
26 lessons
1 h 41 min read
Queues in Laravel 13
18 lessons
1 h 12 min read