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?
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.
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.
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With