Self-hatred

Howto: WordPress powered by Dropbox

As I have previously espoused, Dropbox is fucking awesome. After blogging about using my up remote instant message chat log storage, I turned my attention to managing a WordPress installation from Dropbox. Mostly because. Because it would be, for me, interesting, different and not a little bit cool to see if I can actually do this gracefully and easily, knowing the robustness of WordPress.

My goal is in this project is to create a functioning mirror of Misadventures, albeit with as much content as possible stored in Dropbox for ease of access.

Step 1: Groundwork

My first steps were to create a test site at http://affront.720nm.com (named in honour of those perpetually misunderstood galactic rapscallions, The Affront), export a copy of my WordPress database and download a copy of WordPress to the new site.

Step 2: Installation

I want to start in a very quick and dirty manner by creating the functioning site in the fewest possible steps. Install Create a new database. Install WordPress. Through this guide I am making the assumption that you are capable of managing all the components a full WordPress installation; database creation, file download, upload, and configuration. Etcetera.

Step 2a: Tweakage

I manage my not-inconsiderable mound of photographs in a moderately unconventional manner: Rather than upload the photographs directly through WordPress’ built-in functions, I instead manually size, upload and store them in a certain, specific scheme. I dump them into a folder named content and then subdivide based on post number. WordPress post #1234, first image would be: /content/1234/1.jpg. I do this for several reasons:

  • Perceived portability #1. Every single image is linked as href=”/content/1234/1.jpg”. It makes it easy for me to grab the URL for sharing.
  • Consistency. Should be self-explanatory.
  • Perceived portability #2. Everything is in one folder with a (to me) neat hierarchy tied to the direct blog post.

Conveniently I already had my full image archive backed up in Dropbox.

Back to step 2a. I opened the exported WordPress database in Bluefish and replaced /content/1234/ with http://dl.dropbox.com/u/4144919/website/content/1234/. This takes about five minutes in a text editor on a netbook. Or about ten seconds using sed in a shell.

sed -i 's,/content/,http://dl.dropbox.com/u/4144919/website/content/,g' wordpress-720.sql

Step 3: Import your shiny old new WordPress file

In the real world, the import of my WordPress .xml file choked and died to I moved to doing a direct database copy via phpyMyAdmin export, sed edit, import, change the requisite lines by hand after import. No sweat. I mean, my browser screamed son of a bitch, son of a bitch! a few times as I did a copy and paste. Does that count?

Moving on.

At the simplest level I now have a WordPress site whose media content is stored on Dropbox. Thi saves on bandwidth, saves on (server) hard disk space and conveys some of the advantages of having shell access for those who do not have it: rm, mv, cp, mogrify, and mkdir all become available. It also removes, for me, the tedious need to FTP the images. I drop them into the folder, compose my post and have them available online by the time I finish it.

Step 4: Click and experience!

So as of right now, the first part of my project has been completed: I have a working copy of Misadventures, albeit my content all comes from Dropbox. My next two steps in this project will be to automatically back up my database into Dropbox and to then see if how far I can push in actually running the WordPress installation out of Dropbox.


Categorised as: regular


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>