In any situation where the above elements need to be migrated, it must be considered that the only open data associated with these transactions must be considered.
Below is the sequence I would follow if I were in your position (Which you are )
a) Extract all Complex PO's with Partial advance Payments, Partial Retainages - This is major Problem statement
b) Extract Complex PO's with unpaid advances and un-applied retainages - This is simple, migrate as is.
c) Extract accounting entries for partial recoupment (in case of un-applied prepayments existent)
d) Extract Accounting entries of all applied retainages
Re Define the new complex PO with only data elements which are open, i.e, Pending Retention Amount and Available Advance
Upload it as is.
Refine the data collected in points c & d and migrate as part of open balances in GL.
Net result - Complex PO gets migrated with associated past history in terms of accounting.
Let me know your thoughts.