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

Good afternoon,

I updated every new version, since v.3

A week ago, I tried to update from v.5.0.1 to v.5.2.0

I had difficulties when starting the program or opening a RAW file,
it asks to “update the database”

…\AppData\Local\darktable\data.db

I select “update” and the program closes

I deleted everything several times (like in …\AppData\Local\darktable)
and did a clean installation, the result is the same

I deleted the databases, after starting, the result was only once, when restarting, the message “update the database” and closing the program.

I delete version v.5.2.0, install v.5.0.1 and it works

Log

========================================
version: darktable 5.2.0
start: 2025-07-24 19:21:34

 3,9435 TRY_EXEC 'can't insert meta_data_key record' sql: 'near "я": syntax error'
 3,9437 [init] database `C:\Users\usr\AppData\Local\darktable\data.db' couldn't be upgraded from version 10 to 13. aborting
 3,9448 ERROR : cannot open database

========================================
version: darktable 5.2.0
start: 2025-07-24 19:23:59

 9,1778 TRY_EXEC 'can't create new meta_data_keys table' sql: 'table meta_data already exists'
 9,1779 [init] database `C:\Users\usr\AppData\Local\darktable\data.db' couldn't be upgraded from version 12 to 13. aborting
 9,1786 ERROR : cannot open database

OS
Windows 10 Home
22H2

I would be sincerely grateful for help in this matter

try a reboot of the windows computer. It looks like your database is locked by the previous process

@zisoft Seems to be your SQL. I don’t yet see how that Cyrillicя could cause an error, but that’s my best tip; I also don’t see where it comes from, but I haven’t had my morning coffee yet :slight_smile:

These are the initial metadata titles which come from the localized texts.

Try to set the language to english before the upgrade. Then you will get english metadata tag names which can easily be changed afterwards.

2 Likes

I have created a pull request to fix the issue: 19134

2 Likes

Good afternoon,

You turned out to be right.

The interface language was Ukrainian, set by default in the operating system.

I changed the language to English in version 5.0.1, updated to 5.2.0
After the first launch of version 5.2.0, the data.db database was updated, after it the library.db was updated
After that, it is possible to change the interface language and everything works

Thank you very much

Another question arose after the update, about the white balance, it goes a little green when opening…
But this is probably a completely different thread of discussion