# Upgrading to SQLCipher 4

**URL:** <https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283>\
**Category:** SQLCipher FAQ\
**Created:** [December 10, 2018, 8:16pm UTC](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283 "2018-12-10T20:16:07Z")\
**Posts on this page:** 4\
**Page:** 3

<div class="post-metadata">

**Author:** ![mmoore](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/mmoore/32/858_2.png) [@mmoore](https://discuss.zetetic.net/u/mmoore)\
**Post date:** [April 3, 2024, 2:13pm UTC](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283/45 "2024-04-03T14:13:18Z")

</div>

A post was split to a new topic: [Issue Migrating From android-database-sqlcipher:3.5.9 to sqlcipher-android:4.5.5](https://discuss.zetetic.net/t/issue-migrating-from-android-database-sqlcipher-3-5-9-to-sqlcipher-android-4-5-5/6370)

---

<div class="post-metadata">

**Author:** ![Gokulnath](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/gokulnath/32/2272_2.png) [@Gokulnath](https://discuss.zetetic.net/u/Gokulnath)\
**Post date:** [July 25, 2024, 12:02pm UTC](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283/46 "2024-07-25T12:02:09Z")

</div>

Hi @developernotes ,

I’m trying to migrate db from net.zetetic:android-database-sqlcipher:3.5.9 to net.zetetic:sqlcipher-android:4.5.7 and the hook in the latter is providing SQLiteConnection instead of SQLiteDatabase in preKey() and postKey().

Could you help me on getting the database in postKey and handling the migration?

---

<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:** [July 25, 2024, 1:00pm UTC](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283/47 "2024-07-25T13:00:32Z")

</div>

Hi @Gokulnath,

Here \[1\] is an example of migrating a SQLCipher database to the latest version using the `sqlcipher-android` library.

* * *

1. [sqlcipher-android/sqlcipher/src/androidTest/java/net/zetetic/database/sqlcipher\_cts/MigrateDatabaseFrom1xFormatToCurrentFormatTest.java at master · sqlcipher/sqlcipher-android · GitHub](https://github.com/sqlcipher/sqlcipher-android/blob/master/sqlcipher/src/androidTest/java/net/zetetic/database/sqlcipher_cts/MigrateDatabaseFrom1xFormatToCurrentFormatTest.java)

---

<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:** [November 19, 2024, 2:33pm UTC](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283/48 "2024-11-19T14:33:18Z")

</div>

31 posts were split to a new topic: [Upgrading from android-database-sqlcipher to sqlcipher-android](https://discuss.zetetic.net/t/upgrading-from-android-database-sqlcipher-to-sqlcipher-android/6741)

[Previous page](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283.md?page=2)
