Towards more painless WordPress Upgrades

Or, I make subversion do what I should have done a long while ago.

The basic problem is that there are some updates that I’ve made to bits in this weblog to smooth over the rough bits from the manila migration — .htaccess mods and other little bits. The last security upgrade I did killed my modifications left a lot of old links hanging.

So, Subversion to the rescue.

The first step is to get the current bits into source control, and make the weblog directory source managed. There are a few ways to do that, but the best is to have it already done. The next best appears to be:

  • Extract your base WP archive, corresponding to what you installed in the first place. Do an svn import from there to get yourself a clean baseline, without any cache files or uploaded images. I’m choosing not to have images in my source control, I’ll probably regret that later.
  • Or, copy your live directory, delete the uploads and cache files, and import that. This might work better if you have a lot of themes or other cruft from a lot of upgrades.
  • Do an svn checkout into a new directory.
  • Rsync your current live wordpress directory on top of the the one you just checked out. This will bring in all of your changes in one big batch. Review them, and check them all in.
  • Make the directory where you just checked in your live wordpress install. (Rsync or renaming)

Now, when ever someone breaks into WordPress and they have a new point release, go into your wordpress directory and do a merge. We’re going to merge based on the wordpress subversion repository, get the differences between the patch level that’s installed and that which they just released.

svn merge http://svn.automattic.com/wordpress/tags/2.0.9/

(where you’re going to want that all on one line)

Everything should be a clean update or merge, if there’s a conflict then you’re going to have to manually resolve that before things work again. If it doesn’t look good, you can always revert to your repository version and fix elsewhere. If it looks good, then svn commit and you’re good till the next update.

No comments

No comments yet. Be the first.

Leave a reply

You must be logged in to post a comment.