Search code examples
ioscore-datacore-data-migration

Core Data Migration for a Clean Install


Working on a project that has had a long history of development. There have been several successful core data migrations in the past (before I started working on the app). I'm now working on a few version which requires a manual migration (custom policy, all that).

The manual migration is working when upgrading from an existing version of the app. But if I uninstall the app and deploy the latest version, the app fails to launch with the error message, "Can't find mapping model for migration".

Any thoughts on what is missing in the configuration? do I need to provide a migration from "v1" to the latest version?


Solution

  • A fresh install shouldn't need to have a migration. If the app is copying over a "starter" database, that database should be updated and repackaged into the bundle to be copied over on a fresh install. It'd be like downloading an app from a website and it not being the latest version.