Protect previous migrated field values on system of record migration I have a successful migration of content type A, B and C. In the migration of C, I have entity reference fields that get populated with the correct values coming from migration A and B.

My reference fields is a multi value node entity reference field. To prevent the values being over ridden from my previous migrations, I use the system of record method.

https://www.drupal.org/node/1117454
https://www.drupal.org/node/2550939

The example is very specific to a commerce migration.

// If "updating" a product, protect these fields.
        // We know its updating if the product exists in the database with the sku.
        // Migrate updates by deleting an entire entity and replacing with
        // the new one. We circumvent the removal of the values of these
        // fields by pulling them and overriding the defaults provided
        // in the mapping.
        // You could do the same with a nid id found with a title, or something similar.
        // $row-&gt;migrate_map_sourceid1 is usually the entity id you're looking for,
        // our example here uses a commerce_product and loads it with the provided sku
        if ($product = commerce_product_load_by_sku($row-&gt;sku)) {
            // Use the metatdata wrapper to pull values
            $product_wrapper = entity_metadata_wrapper('commerce_product', $product);

            // field_stock
            // Some products have a NULL stock, lets keep the zero default if NULL
            if ($product_wrapper-&gt;field_stock-&gt;value() !== NULL) {
                $row-&gt;stock = $product_wrapper-&gt;field_stock-&gt;value();
            } else { $row-&gt;stock = 0; }

            // field_max
            $row-&gt;max = $product_wrapper-&gt;field_max-&gt;value();
        }


I am not sure how I would use my prepare row, current content types, their ids etc to remove the current values, update the new values, and then add the previous ones again? Or am I misunderstanding how this is suppose to work? Thanks in advance!
My solution was to use the prepare($node, stdClass $row). This basically takes the current values and joins them to the new ones.

https://www.drupal.org/node/1222668#comment-4795190