I have a first app (App1) which has a Core Data data model (model1). I have completely rewritten the app (app2) in a separate Xcode project and it has a new data model (model2).
I am trying to understand how I can migrate the persistent store of app1 and model1 to app2 and model2 so that a user's data is transferred over.
There are some differences between model1 and model2 (entity/attribute/relationship names etc) but I think these can be dealt with via lightweight migration. Therefore, currently my main problem is working out how to link model2 to model1 so that app2 can attempt the migration.
I have tried copying the model1.xcdatamodel file into the new project for app2 and then versioning this model1 with a new version corresponding to model2.
The app launches and doesn't crash, but none of the data is transferred. I have included the persistent store options as follows:
let options = [NSMigratePersistentStoresAutomaticallyOption: true, NSInferMappingModelAutomaticallyOption: true]