storesafe/cordova-sqlcipher-adapter

cordova-sqlite-plugin and existing database

davguev opened this issue · 3 comments

Hello!
I have an app which uses cordova-sqlite-plugin for its database.

  1. If I install cordova-sqlcipher-adapter, can I remove the first plugin? Or do I need both? I tried removing the sqlite-plugin and the app couldn't find the object sqlitePlugin.
  2. If the app has already its database X without cipher, and then install a new version of the app with the cipher, does it cipher the existing database X? If it's doesn't do it automatically, how can I achieve it without deleting the data already stored?
  1. cordova-sqlcipher-adapter, can I remove the first plugin?

Yes and you better remove the other plugin first. Keeping both plugins would lead to undefined behavior.

2. does it cipher the existing database X?

No. You would open the database using no password key option.

2. how can I achieve it without deleting the data already stored?

I recommend you read the data with no key and store it in a new database using your secret password key.

SQLCipher has migration support, which is not directly supported by this plugin.

Hi,

Could you please add this information of removing cordova-sqlite-plugin before installing your plugin in readme file. Even I was debugging for long time on why this was not working until I hit this issue.

Thank you,
Naren

@davguev Could you guide me on how to migrate data from one DB to secure DB.