# Upgrading from android-database-sqlcipher to sqlcipher-android

**URL:** <https://discuss.zetetic.net/t/upgrading-from-android-database-sqlcipher-to-sqlcipher-android/6741>\
**Category:** SQLCipher\
**Created:** [September 5, 2024, 1:20pm UTC](https://discuss.zetetic.net/t/upgrading-from-android-database-sqlcipher-to-sqlcipher-android/6741 "2024-09-05T13:20:19Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [September 20, 2024, 1:36pm UTC](https://discuss.zetetic.net/t/upgrading-from-android-database-sqlcipher-to-sqlcipher-android/6741/16 "2024-09-20T13:36:21Z")

</div>

Hi @FrozenPyrozen,

> [@FrozenPyrozen](#):
>
> we storing user in `SQLiteDatabase` which imported from `import net.sqlcipher.database.SQLiteDatabase;` and we updating the `sqlcipher` to `4.5.4` and installing newer build, by default do `sqlcipher` library do some changes for example how db was encrypted/decrypted and old data becomes unavailable or it should work by default with prev version created, encrypted db without any changes/logouts?

You previously mentioned using SQLCipher for Android 3.5.7. If you are upgrading to SQLCipher for Android 4.5.4, you will need to review the [upgrade recommendations](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283) as SQLCipher 4 will not open a SQLCipher 3 database by default, there are several approaches to address this.

> [@FrozenPyrozen](#):
>
> What are the possible triggers/events that could lead to clearing user data from db etc?

SQLCipher for Android uses the `DatabaseErrorHandler` (similar to [android.database.sqlite.DatabaseErrorHandler](https://developer.android.com/reference/android/database/DatabaseErrorHandler)) using the [default implementation](https://github.com/sqlcipher/android-database-sqlcipher/blob/master/android-database-sqlcipher/src/main/java/net/sqlcipher/DefaultDatabaseErrorHandler.java#L35) which will delete the file on corruption. This is consistent with the `android.database.sqlite` package. You can override this behavior by providing your own implementation for a `DatabaseErrorHandler` via constructor argument to a `SQLiteOpenHelper` subclass, or the static `openDatabase` or `openOrCreateDatabase` on the `SQLiteDatabase` class.

---

_[View the full topic](https://discuss.zetetic.net/t/upgrading-from-android-database-sqlcipher-to-sqlcipher-android/6741)._
