I have an old database table I used in mySql, that I would like to migrate to my new postgres DB. Has I'm using symfony, I created migration command line, that gets my data from the old DB, format it and treat it, create new entity through the symfony setters of my entity and flush the data.
To avoid to query the entire table which is big, I created a loop that gets every 100 lines of the table, format the data, until the table is entirely scanned. The fact is that it's very slow...
My old DB table have like 2000 lines, but for every line treated, I create one entity which is bind by relation to 9 other new entity created.
When I launch the custom command line to initiate the migration. It takes almost 12 minutes to scan the entire table.
How can I speed up the process and improve my symfony performances ?