Skip to content

Upgrading Digikam from 4.x to 5.x and wrong AlbumRoots

(Not so) recently I upgraded a Debian system from Jessie to Stretch. Along with that came an upgrade of the Digikam photo management application from version 4.x to 5.3. After starting that the first time the albums were empty. WTF? Putting the modified digikam4.db aside, creating a fresh one and restoring the old one and comparing those revealed that they differed in how the AlbumRoots path was stored. Digikam 4.x stored it as volumeid:?path=%2Fhome%2F... (with URL encoded %2F as / slashes) where Digikam 5 stores a literal / slash. Changing that to what Digikam 5 expects did the trick and the albums were there again. So when upgrading, before you start Digikam 5 for the first time, do the following (assuming the database is /home/you/Pictures/digikam4.db)

  • backup your original digikam4.db file
  • install the sqlitebrowser package if not installed yet
  • on a terminal command line invoke: sqlitebrowser ~/Pictures/digikam4.db &
  • go to the Browse Data tab
  • Table: AlbumRoots
  • select (click into) the identifier field
  • in the right edit field change its content from volumeid:?path=%2Fhome%2Fyou%2FPictures to
    volumeid:?path=/home/you/Pictures
  • Write changes and exit

Start digikam. All good (hopefully ;-)

Update 2017-11-27T14:50+01:00
Forgot to mention that when starting Digikam 5 the first time a dialog appears offering to migrate from version 4, it advises to not do so but has migration preselected, do not migrate there or it will mess things up. You may lose some existing personal preferences, but the migration for me at least simply did not work.
Related seems to be KDE bug 364258 though claimed to be fixed.