'How to do data migration to a new DB (not database migration)

I have a Laravel project with a database with a lot of data. I have created a new version (new code) with an improved database structure that has some different naming and some new relationships. I want to migrate the data from the old DB to the new one. There are foreign keys. What is the best way to do this? Is there a tool/library that will make this easier, e.g. a UI interface to map old DB to new DB, or a special php library for data migration, etc.? Or do I just need to go through all tables in the proper order with php db code and insert the data into the appropriate tables in the new DB?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source