Hi,
I am currently utilizing sqlite3_backup
to upgrade an encrypted version 3 database to version 4 while online. When I create a version 3 encrypted database using SQLCipher version “4.8.0” with PRAGMA cipher_compatibility=3
and subsequently transfer it to a version 4 database with sqlite3_backup
, the process operates without issues.
However, I discovered a problem when creating an encrypted version 3 database using an older SQLCipher version such as 3.4.1. If I then attempt an upgrade to version 4 with sqlite3_backup
using version 4.8.0, the process completes without error, but reopening the database results in an error: “SQLite Error [11]: malformed database schema (orphan index in ‘PRAGMA integrity_check(10)’)”.
Steps to reproduce the issue:
- Create a test database using SQLCipher version lower than 4.3.0, such as 3.4.1.
- With SQLCipher version 4.8.0, open the test database using
PRAGMA cipher_compatibility=3
, create a new backup database withoutPRAGMA cipher_compatibility=3
, then sqlite3_backup the test database to the backup database. - Close and reopen the backup database, then execute a select query for testing.
Thank you for your attention to this matter. Your assistance is greatly appreciated.