You need to remove orphaned data before you upgrade MDB as per below.
1. Run a SQL query and check if there is a data in a table pointing to non-existing data in a referenced table.
e.g. In this case, run the following query to check if data in ca_contact table pointing to non-existing data in ca_contact_type table.
SELECT * from ca_contact where contact_type IS NOT NULL AND contact_type NOT IN (SELECT id from ca_contact_type)
2. If you find a data pointing to non-existing data, please modify it through the web interface, or other ways to collect the data, such as pdm_extract/pdm_load commands, if the data is not displayed in the web interface.
3. Apply the Cumulative patch or migrate SDM again.