Q:

When performing a Core Data migration, how can I carry over old values from the source store from a different entity?

I'm performing a migration using Core Data's standard mapping model approach, and it seems to be working fine, except for one thing: I've moved an attribute from one entity to another, and I want to move the underlying value from the source store to that new entity as part of the migration.
This should be possible, but I'm having trouble figuring out which steps I need to take to accomplish this.

A:

I think one way is to subclass NSEntityMigrationPolicy and put your logic there. There you can import the class files of the other needed entity.
In Xcode you can set the "Expression" under "Attribute Mapping" as FUNCTION($entityPolicy, "yourMethodName", $source).

