Issue with Darktable Not Opening After Upgrade

I had an old version of Darktable, which I uninstalled along with all its related databases. After installing the latest version, I keep encountering the following message when trying to open the app:

The database schema must be updated for appdata/local/darktable/library.db.
For large databases, this process may take a long time. Would you like to continue or exit now to create a backup?

When I choose to update the database, nothing happens—the app simply closes. This keeps repeating, and I can’t even open Darktable.

Has anyone experienced this issue? How can I fix it?

Hi @aidayg24 welcome to the community!

You should probably start dark table from the command line, get the resulting log, and share it here. Then we can help you with a percise fix.

You can see how to start from the CLI here: faq | darktable

Uninstalling does not remove either the database or configuration. If you really want to get rid of them, you’ll have to do that manually.
However, darktable should be able to migrate them. Please do as Mica suggested, and share the log. Your operating system, your old and new darktable version could also be important. (‘latest’ could be the 5.0.1 release, a weekly build, a nightly build, your own build from whatever the current state of the master branch is…)

If the suggested fixes don’t resolve your problem it might help to know the OS you are using. I am on Windows and I update every week to the latest version of DT5.1 without problems. Windows asks to uninstall DT and then it installs the new version. Sometimes it will ask to update the database when I start the new version and I allow this and the process is very quick in my case.

I had this same issue on Windows 10, trying to migrate from 4.6.1. I didn’t think about starting from the command line. The only fix was to move ~/appdata/local/darktable out of the way - so no migration done. Is there no log created when run from windows start? It’s not in the old darktable directory, or my home directory.

The logs should be in your “my documents” folder.

Ah, ok, here it is:

version: darktable 5.0.1
start: 2025:05:31 11:41:21
27.1859 TRY_EXEC ‘can’t create table overlay’ sql: ‘attempt to write a readonly database’
27.1861 [init] database `library.db’ couldn’t be upgraded from version 47 to 56. aborting
27.2026 ERROR : cannot open database

Don’t know why - maybe, a lockfile?
On another computer the upgrade from 4.6.1 worked fine.

[edit] there’s no obvious lock file and I can drop the library.db file into the firefox sql plugin just fine - though i didn’t try writing to it

Make sure antivirus hasn’t locked the file if there is no .lock files left over from darktable. If that doesn’t work either, the db might be corrupt. You can use sqlite3 to test the database.

I did open the file with the Firefox sqlite plugin and it looked ok, no complaints. Is there some internal db lock?
My antivirus is Windows Defender, so no issue there.

If there are locks from a dt crash, there will be a library.db.lock file next to library.db