<?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>Coming Full Circle &#187; gallery2</title>
	<atom:link href="http://www.jackpo.org/tag/gallery2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jackpo.org</link>
	<description>"I dream of things that never were, and ask why not." - RFK</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:56:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gallery2 to Flickr Migration</title>
		<link>http://www.jackpo.org/2010/02/26/gallery2-to-flickr-migration/</link>
		<comments>http://www.jackpo.org/2010/02/26/gallery2-to-flickr-migration/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 06:48:08 +0000</pubDate>
		<dc:creator>JackPo</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[gallery2]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.jackpo.org/?p=363</guid>
		<description><![CDATA[For half a decade, I have depended on the great open source Gallery2 project to host my photo galleries. Unfortunately, I am finding myself with less and less time to devote to maintaining the installation, and many useful social media features have yet to make it into its code base. So, I finally decided to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 15px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.jackpo.org%2F2010%2F02%2F26%2Fgallery2-to-flickr-migration%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.jackpo.org%2F2010%2F02%2F26%2Fgallery2-to-flickr-migration%2F&amp;source=jackpo&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.jackpo.org/wp-content/uploads/2010/02/gallery2-logo.png" alt="" title="gallery2-logo" height="110" class="alignleft size-thumbnail wp-image-367" /></p>
<p>For half a decade, I have depended on the great open source <a href="http://gallery.menalto.com/">Gallery2</a> project to host my photo galleries.  Unfortunately, I am finding myself with less and less time to devote to maintaining the installation, and many useful social media features have yet to make it into its code base.  So, I finally decided to port my entire gallery into <a href="http://www.flickr.com">flickr</a>.  </p>
<p>Much to my surprise, there are lots of scripts in the gallery database to import photos from flickr, but no functional scripts to export photos out of gallery2 into flickr.  Several past attempts have been made, but I can get none of them to work properly.  So I did what any good coder would do, I modified the existing scripts until it worked.  I am providing the scripts I hacked at the end of this post.  There are several caveats with the scripts that I&#8217;m including here:</p>
<ol>
<li>It&#8217;s recommended that you run this script (export-gallery.php) using command line php, or else the script might pre-maturely end due to Apache rest times.  I also have <code>max_execution_time = 0</code> set in my php.ini.  </li>
<li>It&#8217;s recommended that you dramatically increase resource limitations on your mysql server when attempting to run this script.  I made no attempt at optimizing mysql calls at all.   The script basically makes a new call whenever it wants new data.  I have <code>wait_timeout=600</code> set in my my.cnf.  </li>
<li> I offer NO support whatsoever for these scripts.  They were created to ease my own personal transitions, and reading them should be fairly easy.</li>
<li>The script utilizes <a href="http://phpflickr.com/">PHPFlickr</a> and is based on <a href="http://www.wildgardenseed.com/Taj/Export_Gallery2_to_Flickr.shtml">mindlesscode.net</a>&#8216;s version of export-gallery.  Several major upgrades to the original script have been made, including the ability to export sub-albums.  </li>
<li>I recommend only using getToken.php in phpFlickr, as I personally could not get PHPFlickr&#8217;s API authentication to work in any reliable fashion.</li>
<li>You should see a line like this in export-gallery.php <code>i.".DATABASE_COLUMN_PREFIX."ownerId=10 AND </code>.  This allows you to export galleries on a per-user basis.  You can look up the userid information in the gallery2 tables.  </li>
</ol>
<p><img src="http://www.jackpo.org/wp-content/uploads/2010/02/flickr_logo.jpg" alt="" title="flickr_logo" height="70" class="alignright" /><br />
So with that said, click <a href='http://www.jackpo.org/wp-content/uploads/2010/02/export-to-flickr.zip'>here</a> to download the script. You can run it by typing <code>php export-gallery.php</code> on the command line after editing a few variables at the top of export-gallery.php and setting up the API key / token combination from flickr.  I used this very useful <a href="http://phpflickr.com/tools/auth/">link</a> from PHPFlickr to get my token after setting up the API key.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jackpo.org/2010/02/26/gallery2-to-flickr-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

