Prevent data loss from delayed schema deployment

Hi all,

I recently discovered that I forgot to deploy my CloudKit schema changes from development to production - an oversight that unfortunately went unnoticed for 2.5 months.

As a result, any data created during that time was never synced to iCloud and remains only in the local CoreData store. Once I pushed the schema to production, CloudKit resumed syncing new changes as expected.

However, this leaves me with a gap: there's now a significant amount of data that would be lost if users delete or reinstall the app.

Before I attempt to implement a manual backup or migration strategy, I was wondering:

  • Does NSPersistentCloudKitContainer keep track of local changes that couldn't be synced doe to the missing schema and automatically reattempt syncing them now that the schema is live?
  • If not, what would be the best approach to ensure this "orphaned" data gets saved to CloudKit retroactively.

Thanks in advance for any guidance or suggestions.

Prevent data loss from delayed schema deployment
 
 
Q