Skip to main content

Cannot open database

J
Written by Jason Fried

If Confidant launches into a "Cannot open database" screen instead of the patient list, the encryption key in .dbkey doesn't match what was used to encrypt the database.

What this means

Your data is on disk and encrypted. The matching key lives in a file called .dbkey inside Confidant's data folder. For some reason those two have gotten out of sync — either the .dbkey was overwritten, deleted, or the database was restored from a different point in time than its key.

Most common causes

  1. You restored the database file from a backup but not .dbkey (or vice versa). The key and the database have to come from the same snapshot.

  2. You did a clean reinstall and Confidant generated a new .dbkey before you restored your old data folder. The new key doesn't match the old data.

  3. The .dbkey file was manually deleted or modified.

  4. A migration tool didn't carry the data folder forward correctly and left mismatched files.

Your options

Option A: Restore the matching .dbkey

If you have a backup of the data folder, the simplest fix is to restore the entire folder again — both the encrypted database and .dbkey come from the same snapshot, and Confidant will open right up.

The data folder lives at:

  • macOS~/Library/Application Support/com.confidant.notes/

  • Windows%APPDATA%\com.confidant.notes\

Quit Confidant first, restore the whole folder from your backup, then relaunch.

Option B: Reset the database and start fresh

The error screen has a Reset database and start fresh button. This is destructive — Confidant generates a new .dbkey and starts you in onboarding again. Existing patients, sessions, transcripts, and notes are lost (well, the encrypted file is left behind on disk, but it can no longer be opened).

Use this only if:

  • You don't have any data to recover, or

  • You have an external backup of your data that you'll restore separately

Option C: Recover the data manually

If your data is irreplaceable and Options A and B don't work, contact support. We can sometimes help recover data if you have:

  • An older copy of .dbkey somewhere (Time Machine snapshot, manual backup folder)

  • The encrypted Confidant database file intact

  • Reasonable timing — the more snapshots you have available, the better the odds

We deliberately can't recover data without the original key. The encryption is the encryption.

Preventing this in the future

  • Use Time Machine (Mac) or Windows Backup with the data folder included. This is the default — both database and .dbkey are inside the data folder, so they're backed up as a unit.

  • Treat backup-restore as an all-or-nothing operation on the data folder. Don't selectively restore individual files.

  • Avoid manually editing or deleting .dbkey. If you need to "reset" Confidant, use the Reset button on the error screen rather than deleting files.

Did this answer your question?