Handling deprecated fields during migration


I’ve exported Facility data from a 7.2 environment using the Export API, then when I try to import them back in a 7.6 environment I hit the following exception:

Cannot convert object to Facility for create argument this: Extraneous property "consumptionSourceData" on object type "Facility".↵value: {"type":"Facility","geometry":{"latitude":...,"longitude":....},"address1":"... [InvalidInputParam]"

When I looked to the type Facility in 7.6 I couldn’t see this field, I but in 7.2 I can see the field consumptionSourceData documented as follows:

consumptionSourceData: string enum
An identifier where energy consumption data is available for this facility. @deprecated. Should be identified with metrics.

Enum: Billing, Meters

The solution is to remove this field from each data instance before the upsert, but is there another way to handle this cases during migration?