Re: Transferring Photos



James/Mathieu

On Wed, 2008-03-19 at 11:11 -0400, Mathieu Avoine wrote:
> Sure. The paths to the pictures is pointing to the old directory
> structure in the photos database, so what you must do is either tell
> F-Spot to point to the new directory, or simulate the old directory
> structure.

There could be a third way - alter the database to point to the new
directory structure.

1: Take a copy of the database.  It is stored in
	~/.gnome2/f-spot/photos.db
on my Debian system.

2: Use the text based sqlite CLI command to access the database
    Note: On my Debian system this is sqlite3 as sqlite is for the 2.x
version and my F-Spot database needed 3.x

	$ sqlite ~/.gnome2/f-shot/photos.db
	SQLite version 3.5.6
	Enter ".help" for instructions

3: Check the current state of the photos table:

	sqlite> select id, directory_path from photos;
	.
	.
	.
	195|/home/steve/Photos/2008/03/01
	196|/home/steve/Photos/2008/03/01
	198|/home/steve/Photos/2007/03/02
	199|/home/steve/Photos/2007/03/02
	
4: Danger Will Robinson! Danger!
Change the database to point at the new location of the photos

	sqlite> update photos set directory_path = '/home/dobson/'||
substr(directory_path,13);

Note: "13" is the offset from the start of the dir path string to the
start of that part of the path that we want.  It is 13 for me because my
home account is in "/home/steve/" which is 12 chars long.  Your base
path may will be different.

5: Reuse the select command from 3 to check that the paths look valid
for the new structure.  If not either modify 4 appropriately or restore
the backup and try again.

6: Exit sqlite (Ctrl-D) and test.  I restored from backup because I
don't want to go thought the pain of creating a new user account and
copy everything over, so this method is untested.  There maybe other
database tables/fields that need modification.  

If I've missed something or am wrong you can always restore from the
backup you took in step 1.  You did do step 1 didn't you?  :-)

Hope this works, please let me know.

Steve




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]