How to move F-spot pictures folder to another folder (version 0.6.1.5 or higher)

After my second hard disk started failing, I really thought about moving my +11000 pictures to my young main hard disk, BUT, also keep all my favorites, tags, comments in F-spot.

F-Spot
F-Spot

So here’s how I did it:

  • Close F-spot and open a Terminal.
  • Make a backup copy of the F-spot database:
    cp -a ~/.config/f-spot/photos.db ~/.config/f-spot/photos.db.backup
  • Open the database using the command-line sqlite3 tool:
    sqlite3 ~/.config/f-spot/photos.db
  • Our old folder is “/some/old/folder” and the new folder will be “/shiny/new/folder” (make sure it doesn’t already exist!), so we’ll have to do this (replace with the folder names you want, at 6 spots total!):
    UPDATE photo_versions SET base_uri=REPLACE(base_uri,'/some/old/folder/','/shiny/new/folder/') WHERE base_uri LIKE 'file:///some/old/folder/%';
    UPDATE photos SET base_uri=REPLACE(base_uri,'/some/old/folder/','/shiny/new/folder/') WHERE base_uri LIKE 'file:///some/old/folder/%';
  • Close the database:
    .quit
  • Now mv your folder “/some/old/folder” to “/shiny/new/folder” (make sure it doesn’t already exist!):
    mv "/some/old/folder" "/shiny/new/folder"
  • Wait til everything is moved, and then open F-spot.

3 Replies to “How to move F-spot pictures folder to another folder (version 0.6.1.5 or higher)”

  1. Thanks, but this does not work completely for me with fspot 0.6.1.5! Some Thumbnails are missing, even after updating them.
    Also, when I type something into the comment field fspot crashes each time after a few seconds.
    Console ouput is:
    Unhandled Exception: Mono.Data.SqliteClient.SqliteExecutionException: SQL logic error or missing database
    at Mono.Data.SqliteClient.SqliteCommand.ExecuteStatement (IntPtr pStmt, System.Int32& cols, System.IntPtr& pazValue, System.IntPtr& pazColName) [0x00000]
    at Mono.Data.SqliteClient.SqliteCommand.ExecuteStatement (IntPtr pStmt) [0x00000]
    at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32& rows_affected) [0x00000]
    at Mono.Data.SqliteClient.SqliteCommand.ExecuteNonQuery () [0x00000]
    at Banshee.Database.QueuedSqliteCommand.Execute () [0x00000]

    Any ideas?

  2. Solved the problems myself!

    After updating the thumbnails I had to restart F-Spot to make it work.

    The SQL error does not occur anymore after running
    chmod u+x ~/.config/f-spot/photos.db

    Cheers!

Leave a Reply