project-imas / encrypted-core-data

v2.0 - iOS Core Data encrypted SQLite store using SQLCipher
Other
784 stars 236 forks source link

Having troubles with progressive migration #141

Open jasper-ch-chan opened 9 years ago

jasper-ch-chan commented 9 years ago

Source Reference: http://www.objc.io/issue-4/core-data-migration.html

It recently came to my attention that automatic lightweight migration has the limitation where:

1) If the device has a data model that is more than one version behind the most up-to-date model 2) No data model is created for the current version to the latest version

Automatic lightweight migration will not successful migrate as expected. I ended up searching on Google and found the resource as pasted in the top confirming my suspicions. A solution was proposed called the progressive migration and it worked successfully for a regular SQLite. However, when I tried to carry this implementation to ECD, I am running into problems. The exception is as follows:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<CoreDataMigrationController: 0x7d687b30>: An -observeValueForKeyPath:ofObject:change:context: message was received but not handled. Key path: migrationProgress Observed object: <NSMigrationManager: 0x7fd48220> Change: { kind = 1; new = "0.02083333"; }

Has anyone experienced this before?

sedwo commented 9 years ago

+1

Siddushri commented 9 years ago

+1

jasper-ch-chan commented 9 years ago

Hey everyone,

So I've made a separate project for anyone who is interested in trying to help figure this progressive migration issue out.

https://github.com/sdwornik/ECD-Migration

I've taken a whirl at it to the best of my abilities and have made some progress, but its still not working entirely. Please feel free to take a whirl at it too if you're interested in helping solve this problem.

gagoyal commented 7 years ago

Hi All I had created something similar to support migration and that can query quickly with encrypted values. I suggest it is worth giving a try for anyone who is trying to secure his CoreData based implementation. Its fast and easy to integrate. Complete steps mentioned in ReadMe. https://github.com/gagoyal/GSJDataEncryptor

Thanks