Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Migration options for iCloud Core Data store

The documentation (as of iOS 8) says only lightweight migrations may be performed on an iCloud backed Core Data store. What options are there if one still needs to perform custom migrations afterwards?

Context: we are about to move to iCloud with our Core Data app, but expect future major schema changes what would still need custom migration via mapped fields, etc.

like image 276
Gaurav Sharma Avatar asked Aug 17 '15 23:08

Gaurav Sharma


People also ask

What is CloudKit Core Data?

Core Data provides powerful object graph management features for developing an app with structured data. CloudKit lets users access their data across every device on their iCloud account, while serving as an always-available backup service.

Do CloudKit apps sync with iCloud users?

This is perhaps the most obvious use for CloudKit: syncing your users' data across their devices. Example: a note taking app where the user can create and read notes on any device associated with their iCloud account. Alternatives: Realm Mobile Platform, Firebase, iCloud KVS, iCloud Documents, custom web app.


1 Answers

The only option is lightweight migration if you are using iCloud. If you need to do a structural change to the model then it must be doable with a lightweight.

You can do alterations to the data after the migration but the migration itself is stuck as lightweight forever going forward.

If you get stuck then you are left with the option of exporting all of the data (perhaps into another Core Data store) and the importing the data again into iCloud as if it were new.

like image 190
Marcus S. Zarra Avatar answered Sep 18 '22 21:09

Marcus S. Zarra