Subversioning WordPress Upgrades

Here is the simple script I use to upgrade all the WordPress sites I run on a single server in one fell swoop. Each site is a Subversion checkout of the WordPress trunk so getting the latest changes and merging them with my version is a simple command, however remembering to do each site was a pain. It also helped me figure out exactly how many WordPress installation I’m responsible for upgrading. (Twenty-seven.) Just fill out the array with the site roots of each install (use locate wp-login.php to find them) and run the script on the command like php upgrade-sites.php. I also like to put the time command in front to see how long things take.

21 thoughts on “Subversioning WordPress Upgrades

  1. That is usable if you’ve got shell acess, not everyone does πŸ™ Plus how does the upgrading process works if some of my files (not in the theme folder) are altered (for example some admin files because to add rel=”external” or added snippet to show my smilies when I post a new msg), does the old file gets overwritten or? Just curious. I use Araxis Merge to compare my installation folder to newly downloaded nightly, pretty easy to use πŸ™‚

  2. It merges them, unless there’s been another change to that line it just works out the differences. However I strongly recommend never touching core files, you should be able to do everything through plugins. This aimed at more advanced users who are somewhat shell savvy.

  3. I got shell access at some servers (running some eggdrops and psybncs) but just not for my personal site :/ Hmmm… Prolly should set up mandrake in vmware and give svn a try just because of the curiosity”.

  4. Sounds like a good idea. I think I might do somwething like this too …. but I only have to manage 2 blogs. πŸ™‚ I’ll probably update from a tag, so that I know what I’m getting.

    Any reason why a tag hasn’t been created for yet?

  5. I use svk to manage my WordPress changes. Yes, I touch core files but I know what I’m doing. If it breaks, I’ll keep the pieces πŸ˜‰

    svk makes it quite to easy to manage your own local branch of a Subversion project.

  6. I’d been avoiding moving my site to an svn build for a while now simply cause it’s a little intimidating. After taking the last 40 minutes to do it, I had good reason.

    Turns out you have to uninstall (eg, delete) wordpress and all it’s associated files, etc before you can run the command to get your blog on SVN. Very scary process – taking down your site. However, once you’ve backed up!! the command is pretty easy and straight forward:

    svn checkout ./

    Then, as in the php file, svn up gets you up-to-date. Scary the first time around, but worth it for future upgrade ease (and downgrade if you want!)

  7. Can’t wait until I figure out how to run “svn blahblah” commands. I’ve never done anything involving shell access before in my life.

  8. My problem with running SVN from the command line is that I have no clue how to tell SVN not to update any files under wp-content. In other words, I don’t want any of the default themes, in particular, because t hen they show in the theme switcher I might have installed on some blogs… So I always do an SVN update to a folder on my Desktop and upload all files except wp-content/* manually… It’s a pain in the ass.

  9. Okay, if I have a working wordpress install, and a brand new subversion install, has anyone written a short howto on getting the process started? Do I simply issue the svn /path/to/wordpress file:///blahblah -m “initial”; rm -rf /path/to/wordpress; svn co blah/trunk ?? And then what do I do with upgrades? Unpack update; check it in to svn, and then check it out on top of my site?

  10. So basically drop rewrite the appropriate files on each blog, lets say all 27, then run the upgrade script from shell 1x (as long as all 27 paths point to upgrade.php)?

    Sounds easy, and I like it.

  11. Does anyone have an idiot proof(ish) walkthrough for this SVN upgrade malarky? Its means nothing to me, but Id like to do this easy upgrading thing if I can.
    While im here, how about a little “Upgrade” button in the WP admin, Matt?

Comments are closed.