Your system based on mySQL, PHP, and Angular 7 - is that a system based on the DHIS2 data model (and if yes, which version?) or a different model?
Because if it’s a different system/data model altogether, and since technically converting the database from MySQL to PostgreSQL do not change the data model (tables, indexes, constraints), you won’t be able to use the data in DHIS2.
Trying to design some kind of back-end “conversion layer” between DHIS2 and another data model makes little sense to me - it would be a nightmare to maintain even if you managed to design it in the first place.
So if your legacy data model is different, you need to
- design the equivalent configuration (meta-data, reports, etc) in DHIS2
- map the legacy tables & fields to the equivalent meta-data in DHIS2
- transfer the data
I’m not sure what you mean by “huge” database, but if it is a few hundred GB, I would not recommend using the DHIS2 API for the transfer of data. I would look at ways of inserting the data directly into the DHIS2 database. Which is straightforward in terms of aggregated data and event data, but more difficult with tracker data (you don’t indicate what type of data it is).
As a general approach, I would add the relevant DHIS2 uid values etc to the tables in your original db, and then dump the data out in a format that can be directly imported into the DHIS2 data model.
My 2c worth