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
[NEW] Practical Laravel Security: Packages, Secrets, Supply-Chain Attacks
7 lessons
43 min read
AI Agents/IDEs for Laravel: May 2026 (Claude Code, Codex, OpenCode, etc)
7 lessons
52 min
How to Structure Laravel 13 Projects
16 lessons
1 h 32 min read