Safe conversions • Backups first

Migrate SQLite to SQLCipher (and Back)

Convert a plain SQLite database into an encrypted SQLCipher one, and decrypt encrypted databases back to plain SQLite. Use safe export/import flows and verify integrity on Windows.

Convert plain SQLite → SQLCipher (encrypted)

  1. Open the plain DB — open your .db/.sqlite file in DB Browser.
  2. Export to SQL — use Export → Database to SQL to create a dump.
  3. Create a new encrypted DB — File → New Database, then set a strong passphrase when prompted.
  4. Import the SQL dump — Import → Database from SQL into the encrypted DB.
  5. Verify integrity — run PRAGMA cipher_integrity_check; and test queries.
Tip: Keep the old file until you validate row counts, schema objects, and application compatibility.

Decrypt SQLCipher → plain SQLite

  1. Open with key — open the encrypted DB using the correct passphrase and parameters.
  2. Export to SQL — Export → Database to SQL to dump schema and data.
  3. Create a new plain DB — File → New Database without encryption.
  4. Import the SQL dump — Import → Database from SQL.
  5. Validate — check object counts and sample data; run PRAGMA integrity_check;.

Move between SQLCipher versions (v3 ↔ v4)

FAQ

Will views, triggers, and indexes migrate correctly?

Yes. The SQL export includes schema objects and data. After import, verify that triggers fire as expected and all indexes exist.

Can I migrate in-place without export/import?

For best safety and compatibility, use export/import. Direct PRAGMA rekey may not cover version/parameter changes between environments.

My app still can’t open the migrated DB.

Confirm SQLCipher parameters, and try migrating using the same tool/version as your app. See Troubleshooting.

Page last modified: --
|