Results 1 to 2 of 2

Thread: Relocating your existing F-Spot photo store (e.g. ~/Photos to ~/Pictures)

  1. #1
    Join Date
    Jul 2006
    Location
    Hertfordshire
    Beans
    454
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    Relocating your existing F-Spot photo store (e.g. ~/Photos to ~/Pictures)

    This allows you to move your entire photo store to a different location, and instruct F-Spot to use this new path without re-importing photos and risking data loss:

    QUIT F-SPOT FIRST!!!

    1. Move the photo store where you want it to be (if you haven’t done so already!)

    2. Back-up your F-Spot database

    Code:
    cp ~/.gnome2/f-spot/photos.db ~/.gnome2/f-spot/photos-backup.db
    3. Install and start sqlite

    Code:
    sudo apt-get install sqlite3
    sqlite3 ~/.gnome2/f-spot/photos.db
    5. Perform an update command against the “photos” table. Make sure you set the paths to match your own

    update photos set directory_path = '/NEW/PATH' || substr(directory_path,length('/OLD/PATH/'),length(directory_path)) where directory_path like '/OLD/PATH/%';
    Example:

    update photos set directory_path = '/home/sean/Pictures/photos' || substr(directory_path,length('/home/sean/Photos/'),length(directory_path)) where directory_path like '/home/sean/Photos/%';
    6. Quit sqlite

    Code:
    .quit
    From here on, assuming these steps worked, you should be able to start F-Spot and all your photos are still found!

    ***
    If something went wrong, you can revert to the old database by moving the photos back where they were, and running this command:

    Code:
    mv ~/.gnome2/f-spot/photos-backup.db ~/.gnome2/f-spot/photos.db
    ***

    NOTE: F-Spot appears to rebuild it’s thumbnail cache when you start it the first time after doing this, you will notice that all the photos have no images. Leave it for a few minutes and you should find all the photos will eventually flood back into existence.

    Thanks to nozell.com and itjungle.com for pointers.

  2. #2
    Join Date
    Jul 2007
    Beans
    9

    Re: Relocating your existing F-Spot photo store (e.g. ~/Photos to ~/Pictures)

    A neater way of doing the same thing in sqlite3 is:

    Code:
    update photo_versions set uri = replace(uri,'file:///old/path/','file:///new/path/');
    Note also that you will have to update the photo_versions table as well:

    Code:
    update photo_versions set uri = replace(uri,'file:///old/path/','file:///new/path/');

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •