# How will I check if the database file is SQLCiper3.5 or SQLCipher4.1?

**URL:** <https://discuss.zetetic.net/t/how-will-i-check-if-the-database-file-is-sqlciper3-5-or-sqlcipher4-1/3661>\
**Category:** SQLCipher\
**Created:** [May 10, 2019, 8:02pm UTC](https://discuss.zetetic.net/t/how-will-i-check-if-the-database-file-is-sqlciper3-5-or-sqlcipher4-1/3661 "2019-05-10T20:02:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lancecontreras](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/lancecontreras/32/765_2.png) [@lancecontreras](https://discuss.zetetic.net/u/lancecontreras)\
**Post date:** [May 10, 2019, 8:02pm UTC](https://discuss.zetetic.net/t/how-will-i-check-if-the-database-file-is-sqlciper3-5-or-sqlcipher4-1/3661/1 "2019-05-10T20:02:59Z")

</div>

Right now our application uses SQLCipher 3.5.5 and we’re planning to upgrade to version 4.1. I want to check if the database is 3.5, if it is I will migrate it to 4.1.

---

<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:** [May 10, 2019, 8:06pm UTC](https://discuss.zetetic.net/t/how-will-i-check-if-the-database-file-is-sqlciper3-5-or-sqlcipher4-1/3661/2 "2019-05-10T20:06:37Z")

</div>

Hi @lancecontreras

Typically the flow is: attempt to open the database, if it fails, attempt to migrate, if that fails then the key material is incorrect.

My colleague @sjlombardo gave further details in his response here: [Upgrading to SQLCipher 4](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283/17)
