Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Steps to migrate Core Data databases for shipped iPhone apps

What are the recommended steps to be done for migrating Core Data DB changes for updated iPhone apps already shipped?

Is there any prior step one need (should) have done before shipping a Core Data app?

like image 435
epatel Avatar asked Aug 11 '09 19:08

epatel


People also ask

How to migrate Core Data model?

Migrations happen in three steps: First, Core Data copies over all the objects from one data store to the next. Next, Core Data connects and relates all the objects according to the relationship mapping. Finally, enforce any data validations in the destination model.

What is migration in CoreData?

Core Data can typically perform an automatic data migration, referred to as lightweight migration. Lightweight migration infers the migration from the differences between the source and the destination managed object models.


1 Answers

Apple has published a guide with regards to this topic: Introduction to Core Data Model Versioning and Data Migration Programming Guide

If you find the guide hard to follow (and it can be), this SO post may come in handy too:

What do I have to do to get Core Data to automatically migrate models?

like image 113
Boon Avatar answered Oct 02 '22 01:10

Boon