Encrypted Coredata with (Merged Model) Migration issue iOS

DESCRIPTION OF PROBLEM
We have application where the application is not Migrating the data successfully.In the scenario where the data Models are Merged and we have Encrypted Store and there is simple change of addition of new columns in two of the Models.

STEPS TO REPRODUCE
1.Application is already released to client on Enterprise build
2.We are using SQLcipher for using the Encrypted store
3.There are three data Models merged in this Encrypted Store
4.There are two attributes added to the 2 Models which are part on the Encrypted store.
5.During the upgrade the data is not Migrated successfully and hence it is lost.

This may more specific to iOS but is there any known issue around this and also some solution to this ?

Hi @Anjali,

Encrypted Core Data is a really neat project, but we at Zetetic don’t maintain it or have much familiarity with its internals, though we do keep an eye on it. I’m not sure what the current state of migrations is, but if memory serves, it doesn’t handle all the migration scenarios that Core Data handles. This Issue page on GitHub lists several problems or concerns with doing model migrations in Encrypted Core Data:

I’m not sure if any of the issues there are related to your problem but it might be worth a look. Do you know what version of SQLCipher your are working with? The project authors have left a note in the README file that it doesn’t support migrating from SQLCipher 2 to SQLCipher 3 databases:

Along with the move to CommonCrypto, we’ve updated the version of SQLCipher included as a submodule from v2.0.6 to v3.1.0. Databases created with v2.0.6 will not be able to be read directly by v3.1.0, and support for legacy database migration is not yet supported by ECD.