CoreData: replacing a data model with a new version?

My application was originally published with a simple CoreData model. The source code was lost and has since been rebuilt with the all-new CoreData model.

Everything seemed to be all right until you consider installing the old application to be updated. I'm not quite sure, but it seems that installing a new version of an older version published on the App Store is problematic. I am not getting any error messages, but I cannot think of any other reasons why the application will crash quickly.

Is there a relatively easy way to replace the data model from a previous version with a new one?

+5
source share
2 answers

See the Versioning and Data Conversion Programming Guide for Basic Data .

You will need to create a new β€œversion” of your circuit and then transfer to a new circuit.

+3
source

Migrate yourself. Read the history database on first run and copy everything to the new database. If you jailbreak your device, you can access the file system using the file explorer and copy the sqlite database file from the document folder. You can find the coredata model by looking at the Sqlite tables (Ofcourse with a few trial and error).

0
source

All Articles