May
19
21

Subversioning WordPress Upgrades

Asides

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 Comments

  • Max Thrane May 19, 2005 @ 4:59 pm

    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 :)

  • Matt May 19, 2005 @ 5:02 pm

    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.

  • Max Thrane May 19, 2005 @ 5:10 pm

    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”.

  • Matt Doran May 19, 2005 @ 6:06 pm

    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 1.5.1.1 yet?

  • Juergen Kreileder May 19, 2005 @ 6:40 pm

    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.

  • Jeff Minard May 20, 2005 @ 12:28 am

    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 http://svn.automattic.com/wordpress/trunk ./

    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!)

  • Jon May 20, 2005 @ 1:06 am

    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.

  • Aaron Brazell May 20, 2005 @ 6:41 am

    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.

  • Geof F. Morris May 20, 2005 @ 8:11 am

    God bless you, Matt. I’m gonna have to send you some CD in appreciation.

  • Tim Hatch May 20, 2005 @ 8:43 am

    Is that first echo supposed to be an exec? Or perhaps backticks instead of double quotes?

  • Matt May 20, 2005 @ 9:11 am

    Yes that was supposed to be an exec. Thanks!

  • fx May 21, 2005 @ 12:45 pm

    Its painful to admit (on account of the simplicity of it) but thats a great post. Will make life easier

  • William May 21, 2005 @ 2:24 pm

    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?

  • Senior Mover May 22, 2005 @ 2:36 pm

    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.

  • matthew May 23, 2005 @ 6:39 am

    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?

  • matthew May 23, 2005 @ 7:06 am

    ahh, I got svn listing with svnx and subversion
    http://www.macupdate.com/search.php?keywords=svn&os=macosx

    now what? how do I update my server?

  • matthew May 23, 2005 @ 7:58 am

    nevermind, Im pursuing this elsewhere. Apologies for the spam-a-like practices.

Share Your Thoughts