<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Jeffry Degrande</title>
	
	<link>http://www.jeffrydegrande.com</link>
	<description>for geek in @brasil do geek.hack :code =&gt; :any unless !geek.respond_to?('has_coffee?') end</description>
	<pubDate>Sat, 31 Jan 2009 04:35:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/JeffryDegrande" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Fixing WXR import</title>
		<link>http://feedproxy.google.com/~r/JeffryDegrande/~3/htUwSveYiZY/</link>
		<comments>http://www.jeffrydegrande.com/fixing-wxr-import/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 16:58:32 +0000</pubDate>
		<dc:creator>jeffry</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.jeffrydegrande.com/?p=58</guid>
		<description><![CDATA[We&#8217;re working an a major overhaul of my wife&#8217;s blog.   I&#8217;m implementing the design on a local wordpress install so I exported her content into a WXR file and tried to import that. FAIL!

Every time it hits the 60 second execution time limit, leaving me with half the content.  This always happens [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re working an a major overhaul of my wife&#8217;s <a href="http://www.euvouparardefumar.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.euvouparardefumar.com');">blog</a>.   I&#8217;m implementing the design on a local wordpress install so I exported her content into a WXR file and tried to import that. FAIL!</p>

<p>Every time it hits the 60 second execution time limit, leaving me with half the content.  This always happens when it&#8217;s importing revisions and I don&#8217;t care too much for them. So I&#8217;ll just skip them. The fix is pretty simple.</p>

<p>Open wp-admin/import/wordpress.php and around line 420, add following patch:</p>

<pre><code>    if ( !$post_id or is_wp_error($post_id) )
        return $post_id;
    }
+   else if ($post_type == 'revision') {
+       printf(__('Skipping revision &lt;em&gt;%s&lt;/em&gt;...'), stripslashes($post_title)); 
+       return;
+   }
    else {
        printf(__('Importing post &lt;em&gt;%s&lt;/em&gt;...'), stripslashes($post_title));
        $comment_post_ID = $post_id = wp_insert_post($postdata);
</code></pre>

<p>Then I ran into an issue where orphaned post meta entries were created which is a <a href="http://trac.wordpress.org/7707" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://trac.wordpress.org/7707');">known issue</a>.
I initially just bailed out from the function but there is a <a href="http://trac.wordpress.org/attachment/ticket/7707/wordpress.php.diff" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://trac.wordpress.org/attachment/ticket/7707/wordpress.php.diff');">better fix</a>.</p>

<p>So, around line 390, add this:</p>

<pre><code>    if ( $post_exists ) {
        echo '&lt;li&gt;';
        printf(__('Post &lt;em&gt;%s&lt;/em&gt; already exists.'), stripslashes($post_title));
+       $post_id = $post_exists;
    } else {
</code></pre>

<p>Now the import will go through all the way to the end.</p>
<img src="http://feeds.feedburner.com/~r/JeffryDegrande/~4/htUwSveYiZY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffrydegrande.com/fixing-wxr-import/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.jeffrydegrande.com/fixing-wxr-import/</feedburner:origLink></item>
		<item>
		<title>super simple wordpress backup</title>
		<link>http://feedproxy.google.com/~r/JeffryDegrande/~3/JS-ozc_TebA/</link>
		<comments>http://www.jeffrydegrande.com/super-simple-wordpress-backup/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 22:01:59 +0000</pubDate>
		<dc:creator>jeffry</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.jeffrydegrande.com/?p=41</guid>
		<description><![CDATA[I use an app called gtimelog to track the time I spend on projects.  It&#8217;s a very simple app which doesn&#8217;t get in the way. I&#8217;ve been pretty happy about it for the last 6 months or so. A couple of days ago it started corrupting it&#8217;s datafile 
and I didn&#8217;t have a recent [...]]]></description>
			<content:encoded><![CDATA[<p>I use an app called gtimelog to track the time I spend on projects.  It&#8217;s a very simple app which doesn&#8217;t get in the way. I&#8217;ve been pretty happy about it for the last 6 months or so. A couple of days ago it started corrupting it&#8217;s datafile 
and I didn&#8217;t have a recent backup.  Putting only a couple of days worth of data was pretty painful so I decided to give <a href="http://www.getdropbox.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.getdropbox.com');">dropbox</a> a try.</p>

<p>All the software does is synchronize ~/Dropbox with your online storage.  You get about 2Gb for free which is more than sufficient for what I need.</p>

<p>Lesson learned, I won&#8217;t run into this problem again. I have cron spawning a script every hour or so which compares the file with the previous version and drops a fresh copy in ~/Dropbox if it changed.</p>

<p>Then I started thinking, what about backing up wordpress sites this way.  I don&#8217;t exactly care for the SQL dumps. Installing wordpress from scratch is easy and fast enough.  I <strong>do</strong> care about the content, more specifically about the WXR dumps but I don&#8217;t have any desire to go in there every day and do a manual dump.  Getting to those dumps from the outside turns out to be pretty easy.  Just put a file with something like this in the toplevel directory of your blog:</p>

<pre><code>    &lt;?php
          include 'wp-config.php';
          include ABSPATH . '/wp-admin/includes/export.php';
          export_wp();
</code></pre>

<p>Done! Simple isn&#8217;t it?  The XML is streamed to standard out which means you can call this with a webbrowser.</p>

<h4>Automating everything</h4>

<p>Make sure you give the file a hard to guess name. Kind of sucks to see an exact copy of your content show up somewhere else, doesn&#8217;t it? I used a random string, pulled that through md5sum and tacked .php onto that. Try guessing that <img src='http://www.jeffrydegrande.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>Then, to actually execute it automatically add this to your crontab</p>

<pre><code>  wget -O - http://example.com/hardtoguessfilename.php 
       | gzip - &gt; ~/Dropbox/dump.gz
</code></pre>

<p>The dump will be automatically synchronized within seconds and you have something less to worry about.</p>
<img src="http://feeds.feedburner.com/~r/JeffryDegrande/~4/JS-ozc_TebA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffrydegrande.com/super-simple-wordpress-backup/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.jeffrydegrande.com/super-simple-wordpress-backup/</feedburner:origLink></item>
		<item>
		<title>Elections or carnaval?</title>
		<link>http://feedproxy.google.com/~r/JeffryDegrande/~3/AyKSL-7b70U/</link>
		<comments>http://www.jeffrydegrande.com/elections-carnaval/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 04:19:45 +0000</pubDate>
		<dc:creator>jeffry</dc:creator>
		
		<category><![CDATA[Brazil]]></category>

		<category><![CDATA[politics]]></category>

		<category><![CDATA[rambling]]></category>

		<guid isPermaLink="false">http://www.jeffrydegrande.com/?p=9</guid>
		<description><![CDATA[Had a lot of fun watching Brazil vote today.  As Brazilians usually do, they made a big party of it.  You can&#8217;t vote without having a churrasquinho and some afterwards. I&#8217;m down with that.  Even though bars had to stay closed, the beer brands did well today.

I became rather frustrated with the pre-election campaigns.  I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Had a lot of fun watching Brazil vote today.  As Brazilians usually do, they made a big party of it.  You can&#8217;t vote without having a churrasquinho and some afterwards. I&#8217;m down with that.  Even though bars had to stay closed, the beer brands did well today.</p>

<p>I became rather frustrated with the pre-election campaigns.  I&#8217;m not used to the kind of spam and nonsense each candidate is stuffing down the throats of their voters.</p>

<p>They put your mailbox full with crap and call you at home.  Or run a parade through your street at 8am in the morning.  Big speakers screaming their candidate&#8217;s number mixed with samba.</p>

<p>Glad we got that behind us.</p>

<p>Anyway, enough rambling.  To tell you the truth, I was actually quite impressed.  Voting closed at 17:00. The news at 19:00 reported 73% of the votes in Belo Horizonte already had been counted. 70% nationally.  2 hours is pretty damned fast.</p>

<p>By midnight the results will be in and when I wake up tomorrow morning someone will probably already have cleaned the mess in our street.</p>

<p>The mess created when I voted last time back home still hasn&#8217;t been cleaned up.</p>

<p><a href="http://www.flickr.com/photos/jeffrydegrande/2916872975/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/jeffrydegrande/2916872975/');" title="flyers.jpg by JeffryDegrande, on Flickr"><img src="http://farm4.static.flickr.com/3245/2916872975_e6613e6e06.jpg" width="500" height="375" alt="flyers.jpg" /></a></p>
<img src="http://feeds.feedburner.com/~r/JeffryDegrande/~4/AyKSL-7b70U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffrydegrande.com/elections-carnaval/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.jeffrydegrande.com/elections-carnaval/</feedburner:origLink></item>
		<item>
		<title>It’s a boy</title>
		<link>http://feedproxy.google.com/~r/JeffryDegrande/~3/srGqSgR5kXY/</link>
		<comments>http://www.jeffrydegrande.com/boy/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 23:35:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jeffrydegrande.com/?p=5</guid>
		<description><![CDATA[Just like children, blogs are born every few minutes.  I helped deliver quite a few of them (blogs, not children).  Over the last year I developed lots of wordpress websites, but I never got around to create my own.

So here it is, JeffryDegrande.com.  It&#8217;s a boy, weighs 19 plugins and has blue eyes.

No, seriously, I [...]]]></description>
			<content:encoded><![CDATA[<p>Just like children, blogs are born every few minutes.  I helped deliver quite a few of them (blogs, not children).  Over the last year I developed lots of wordpress websites, but I never got around to create my own.</p>

<p>So here it is, JeffryDegrande.com.  It&#8217;s a boy, weighs 19 plugins and has blue eyes.</p>

<p>No, seriously, I want to burn my feed and I need a post for that.  I promise I&#8217;ll noindex it</p>
<img src="http://feeds.feedburner.com/~r/JeffryDegrande/~4/srGqSgR5kXY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffrydegrande.com/boy/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.jeffrydegrande.com/boy/</feedburner:origLink></item>
	</channel>
</rss>
