ios – How to perform CoreData + CloudKit lightweight migration correctly without affecting user with old version of app?


Currently, I need to add new column/ new index to an entity.

I perform the following lightweight migration, with guideline from

I also add versioning hash modifier, based on

Lightweight migration, by generating another new version of xcdatamodel

enter image description here

Add versioning hash modifier

enter image description here

As per my testing, the SQLite file in my local was migrated without issue.

However, soon, I also need to deploy such new change to iCloud production based on Lightweight CoreData Migration with CloudKit

I was wondering, after I have deployed latest change to iCloud production server

  1. User with latest updated app, should be able sync to iCloud without issue, because latest app has the latest database schema.

But, what about users with old app? Will they face iCloud sync failure, data loss, app crashing issue, because their old database schema is incompatible with latest iCloud’s?

If so, what is the solution for such a situation?