Upgrading WordPress with Subversion

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

As many of bloggers are no doubt aware, a major update to WordPress was released this week. I  like many others, eagerly upgraded my installation to take advantage of many new long-awaited features (particularly on the admin/management end). However for many, upgrading WP means downloading the latest .zip archive, unpacking on one’s local disk, then uploading the entire contents of the unpacked archive (see the irony here?) through an [S]FTP client, wondering why so many micro-tiny files would take soooo long to transfer (it’s easily explainable, but that’s for another discussion). During this protracted upload, one’s WP installation can become instantly unstable as files are being upgraded in place, creating a real-time oil-and-water mix of two different versions.

So what do I do?  Well, obviously not the above. :) With shell access to my hosting account (for Windows users, think DOS command prompt), up until a few months ago, I would get the new version as usual, only I’d upload the .zip file (or in my case, the .tar.gz “tarball”), unpack it on the server, and replace the installation in a couple of seconds; the time to upload (which would be vastly shorter because it would be a compressed, continuous file) would have no bearing on the “out of sync” problem above, because I’d unpack the files in a few seconds. This is a tried-and-true workflow that nobody could argue with in terms of simplicity and speed.

However, there is an even more elegant method that I started utilizing as soon as I found out WP supported a version control utility called Subversion. Version control is used in the software industry to track changes on various files so one can roll back to a previous version. People do this all the time with, say, a document in Word by saving multiple copies, but imagine 50 developers all making changes simultaneously to a source tree of hundreds of files. You have to be able to track changes so that you can fix what breaks while not discarding what got better.  Anyway, I don’t want to get overly technical, but I wanted to give a slightly better understanding of what Subversion is more than the simple statements in the video. Speaking of which, here it is:

thumbnail of video tutorial

Video of WP Upgrade

Cool, eh?  It’s important to know that the above was recorded in absolute real-time, no edits, and that it was really, truly my live system. Aside from the file and database backups before recording, you saw my real, unadulterated upgrade process (while I wasn’t worried having done this many times, the fact that it was done on a Sunday afternoon when traffic was low wasn’t an accident, either ;) ). Once your svn tree is in place, tracking updates large and small really is that easy. There are no big installation files to download or upload (the `svn’ client gets the individual files it needs, but it’s a fast server-to-server transfer) and unlike dropping a new installation on top of the old one, the old, deprecated files are cleaned away. Note that this is the workflow for an existing subversion WP repository; how to convert a “standard” (ie, uploaded) WP install to a subversion-enabled one is the topic for a future post (if there’s interest).

Anyway, I this helped, or at least inspired you to look into checking with your hosting provider to enable shell access if you have it. Please, please, give me feedback on this because I have lots of ideas on similar videos on WP ginsu outside of the web dashboard, most notably using MySQL queries (the database that powers 99% of WP instances) and the like. I admit command-line management isn’t for everyone, but for those willing to start adding to their toolkit, it opens up a limitless world of possibilities.

P.S. I didn’t make this clear, but this was created mainly for friends and readers in the med blogging world who are not necessarily highly technical. If you stumbled upon here from a search or tech-related link, this was not intended to be 100% comprehensive on anything. Condescending comments by tech trolls about how “retardedly simple” this is have already been removed and will not be tolerated.

  • By Robin, December 14, 2008 @ 9:39 pm

    Great video! What did you use to capture it? Great quality and the overall size isn’t daunting when downloading.

  • By enrico, December 15, 2008 @ 4:20 am

    Robin: thanks! I used an older version of iShowU for the Mac to capture a fixed box of screen (rather than follow the mouse around). The resulting video was re-encoded for streaming web delivery with x264 at 4fps (there’s no real motion) and about 256 kbits/s sample rate.

  • By Vijay, December 15, 2008 @ 11:12 am

    I’m impressed! Need to check if I have a shell account first. Then learn this stuff & implement it.

  • By Fat Doctor, December 29, 2008 @ 12:30 pm

    I got confused reading this post. And this is why, despite the limitations, I returned to Blogger. It sucks, but so did my frustration with WordPress.

  • By Welch Allyn, April 13, 2009 @ 12:33 pm

    I’m impressed! Need to check if I have a shell account first. Then learn this stuff & implement it.

Other Links to this Post

  1. How To Make Image Posting to Wordpress Easy and Fast — LucaFiligheddu.com — March 30, 2009 @ 12:18 pm

WordPress Theme Design