Updating an iOS application with SQLCipher included version


#1

Hi All,

I have successfully implemented SQLCipher in my app, its working great. many Thanks to the Zetetic team for sharing this software for free.

As far as I have understood for proper working of SQLCipher it is must that the SQLite database receives PRAGMA_KEY =@“KEY” command, as the first command whenever it is being opened.

Now my confusion arises due to fact that, I already have a app on iTunes store which has local SQLite DB(non encrypted) with app Version (say 1.5), now in version 1.6 of my app I have included SQLCipher to encrypt my app’s database.
As this might be a common scenario and lot of people might have faced, Kindly guide me if my SQLCipher implementation will work after update on the old DB or I need to do some work around.

DB contains user private info which he would not like to be deleted after app update.


#2

Hi @deepak4u2006

You will want to perform your schema migration separately from converting your database from a plain text database to SQLCipher. In order to convert the database you can utilize the sqlcipher_export(…); convenience function. You will want to review example # 1 specifically.


#3

Thanks this is the key point I was searching. Many thanks!!!


#4

Hello @deepak4u2006

We are glad to hear that addresses the issue for you, take care!