Apologies if the solution is buried somewhere in another thread, or post. I could not find anything specific to this. I’m getting [Error: file is not a database].
My scenario:
- Downloaded sqlcipher to a PopOS installation. (3.15.2 //sqlcipher --version)
- Was successful in creating a new encrypted database. Could open, close and see results.
- Downloaded that database fie to MacOS (Catalina). (3.31.0 //sqlcipher --version)
- I opened the database and entered the “PRAGMA key” statement as the first input. Confirmation: “ok”.
- However, anything I do after that results in [Error: file is not a database].
Is this different versions that is causing the issue?
Thanks,
-Santosh
@thomassantosh
This discussion forum post should point you in the correct direction: Upgrading to SQLCipher 4
It sounds like your database was created using SQLCipher v3 and you’re attempting to open it using SQLCipher v4. To verify this assumption is correct, you can run PRAGMA cipher_version on each side.
Thanks. Yes, the different cipher versions was the issue. And the cipher_migrate command helped. I also just updated the Linux installation to 4.4. These instructions were super-helpful https://github.com/sqlitebrowser/sqlitebrowser/wiki/SQLCipher:-Build-from-Source-on-Debian-Stretch---Newbie-Instructions
@thomassantosh
Glad to hear you were able to resolve the issue.