Use the db:migrate command to transfer data
mainTo transfer data from one database to another, first ensure both the source and target connections are configured in your config/database.php file. Then, run the db:migrate Artisan command specifying the source and target connection names using the --schema-from and --schema-to flags.
php artisan db:migrate --schema-from=foo --schema-to=bar