• Subversioned Wordpress Upgrade

    They say, release early, release often and Wordpress is one software that seems to follow that mantra pretty well. Fortunately upgrading from one version of Wordpress to another is a painless task – unless of course you have a customized installation. Upgrading a customized installation can be made easier if you use subversion.

    Normally, in order to upgrade, all you need to do is to delete the old stuff, copy over the set of scripts from the new version and invoke upgrade.php . But if you recursively delete all the old stuff you lose your version control info. So this is my approach to upgrading a customized WP installation which has been subversioned.

    1) copy the files that you have modified into a safe place (themes and plugins will make up the bulk of this)

    2) Download wordpress and unzip it, then change into the source directory and use rsync to copy over the new files while deleting obsolete files from the previous version. the –exclude ‘.svn’ part will ensure that subversion info is not discard. If you are using another revision control system, you can use the appropriate directory here

    rsync . /var/www/raditha/blog/ -avz –exclude ‘.svn’ –delete

    3) Then add new files into the repository with

    svn add `svn stat | grep ‘^\?’ | cut -d’ ‘ -f8`

    4) copy back the themes and plugins (inclusive of the .svn folders).

    4) delete the obsolete ones with:

    svn rm `svn stat | grep ‘^\!’ | cut -d’ ‘ -f7`

    5) Merging – unfortunately there is no easy recipe for this, you need to manually Kompare , Meld or diff the files to see if your code needs to be merged.

    6) commit.

    7) run upgrade.php

  • Friday, March 6th, 2009 at 17:37 | #1

    From 2.7, WP provides a one-click update feature. I upgraded to 2.7.1 with a single click! Details here

  • admin
    Friday, March 6th, 2009 at 18:04 | #2

    yeah, I know , tried it but it wants an FTP account. I said hell no. I don’t even have FTP installed. Only SFTP.

  • admin
    Thursday, June 25th, 2009 at 09:26 | #3

    If you are using URL rewrites you will need to do preserve .htaccess as well. The other day we did an update on Deadlinedue and forgot to save the .htaccess file and promptly broke it.

  • admin
    Thursday, November 5th, 2009 at 19:41 | #4

    BTW, wordpress has mixed up the single quotes and the backticks. I have no idea why software always insists on correcting what we type to produce garbage.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
TOP