<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nozell, rhymes with Oh Hell &#187; sqlite</title>
	<atom:link href="http://nozell.com/blog/tag/sqlite/feed/" rel="self" type="application/rss+xml" />
	<link>http://nozell.com/blog</link>
	<description>Marc Nozell's random stuff -- mostly GNU/Linux, technology, genealogy, family</description>
	<lastBuildDate>Tue, 13 Mar 2012 01:18:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Moving photos around behind f-spot&#8217;s back</title>
		<link>http://nozell.com/blog/2006/07/02/moving-photos-around-behind-f-spots-back/</link>
		<comments>http://nozell.com/blog/2006/07/02/moving-photos-around-behind-f-spots-back/#comments</comments>
		<pubDate>Mon, 03 Jul 2006 01:44:45 +0000</pubDate>
		<dc:creator>Marc Nozell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[dapper]]></category>
		<category><![CDATA[f-spot]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nozell.com/blog/2006/07/02/moving-photos-around-behind-f-spots-back/</guid>
		<description><![CDATA[I&#8217;ve been using f-spot since it showed up in Ubuntu/Breezy and have been keeping all my photos in a directory structure like this: /PHOTOS/Photos/2006.06.30/ /PHOTOS/Photos/2006.07.01/ But sometimes I&#8217;ve forgotten to unclick the &#8220;Copy file to the Photos folder&#8221; box in the photos import dialog and end up with photos under ~/Photos/. Recently I checked and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using f-spot since it showed up in Ubuntu/Breezy and have been keeping all my photos in a directory structure like this:<br />
<code><br />
/PHOTOS/Photos/2006.06.30/<br />
/PHOTOS/Photos/2006.07.01/<br />
</code><br />
But sometimes I&#8217;ve forgotten to unclick the &#8220;Copy file to the Photos folder&#8221; box in the photos import dialog and end up with photos under ~/Photos/.  Recently I checked and found there were almost a gigabytes worth of photos under there. </p>
<p>So this is what I did to move them to under /PHOTOS/Photos/ and keep all the tags and metadata correct.</p>
<ul>
<li>Back up /home and /PHOTOS to an external USB.  I love rsnapshot.<br />
<code>$ rsnapshot daily</code>
</li>
<li>make an extra backup of the f-spot database<br />
<code>$ cp ~/.gnome2/f-spot/photos.db photos-backup.db </code>
</li>
<li>Start poking around the f-spot database and updating it.<br />
<code>$ sqlite3 ~/.gnome2/f-spot/photos.db<br />
sqlite> .schema photos<br />
        CREATE TABLE photos (   id INTEGER PRIMARY KEY NOT NULL,<br />
                                time               INTEGER NOT NULL,<br />
                                directory_path     STRING NOT NULL,<br />
                                name               STRING NOT NULL,<br />
                                description        TEXT NOT NULL,<br />
                                default_version_id INTEGER NOT NULL<br />
                                );<br />
</code>
</li>
<li>See how many photos are in ~/Photos&#8230;<br />
<code>sqlite> select count(*) from photos where directory_path like '/home/marc/Photos/%';<br />
260<br />
</code>
</li>
<li>Take a look at a few of them to see the path names&#8230;<br />
<code>sqlite> select directory_path from photos where directory_path like '/home/marc/Photos/%' limit 0,10;<br />
</code>
</li>
<li>Update the pathname to my prefered one.  I&#8217;ve added an &#8216;a&#8217; to the end just so I won&#8217;t overwrite an existing directory.<br />
<code>sqlite> update photos set directory_path = "/PHOTOS/Photos/2006.06.22a" where directory_path = "/home/marc/Photos/2006/6/22";<br />
sqlite> .quit<br />
</code>
</li>
<li>Make the directory and move the files to the new location&#8230;<br />
<code>mkdir /PHOTOS/Photos/2006.06.22a<br />
mv -v /home/marc/Photos/2006/6/22/HPIM117* /PHOTOS/Photos/2006.06.22a<br />
</code>
</li>
<p>Repeat for each directory.  I did it all within emacs&#8217; shell so cut-n-paste made it a snap.</p>
]]></content:encoded>
			<wfw:commentRss>http://nozell.com/blog/2006/07/02/moving-photos-around-behind-f-spots-back/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

