I know that not everyone who operates their own WordPress blog is an uber-geek so I thought I would share my experience upgrading one of the blogs that I am responsible for from WordPress 2.7.1 to WordPress 2.8 using Subversion (svn). If you are not using Subversion to manage your WordPress install or you are a svn hero, this post is probably not for you =).

Having read about many of the new features in 2.8 I was excited when I finally noticed the “upgrade now” messages in my dashboard today and decided to do it. Armed with the knowledge that my WordPress installs all use Subversion (since I keep access locked down to my servers on a level that probably crosses into paranoia, updating any other way is just a pain) and being the lazy guy that I am, I googled for “svn wordpress update“and clicked the first link: Installing/Updating WordPress with Subversion.

Once in the WordPress Codex, I scrolled down to Updating to a New Stable Version where they provide a great explanation along with exact syntax on how to do the svn switch. I want to mention here how great the documentation is for WordPress, and send a hearty thanks to everyone who contributes to this project!  Anyway, this command worked perfectly on the first blog I updated but the second one threw me an error (this is the part that may be useful to you…):

> cd ../../wordpress/
> sudo svn sw http://core.svn.wordpress.org/tags/2.8/ .
svn: ‘http://core.svn.wordpress.org/tags/2.8’
is not the same repository as
‘http://svn.automattic.com/wordpress’
>

It looks to me like I might have read the Using Subversion page instead of the Installing/Updating WordPress with Subversion page when I installed this site, or perhaps a previous version of the latter referenced the ‘automattic’ repository that I used.  Regardless of how I did it, I am assuming that at least one or two others have done the same thing.  That helps me feel better anyway.

There are two ways to fix / get past this error.  One is to switch to /tags/2.8 in the current repository and the other is to switch the repository that you are using.  Because it appears that the ‘automattic’ repository is intended for use by developers and I am not currently doing any WordPress development, I decided to change to the more appropriate ‘core’ url (although it may not matter at all).

If you want to stay in the same repository, just use it instead of the one supplied in the codex for your command, in my case the edited command would have looked like this:

svn sw http://svn.automattic.com/wordpress/tags/2.8/ .

At first I thought that to change repositories I would have to effectively do a whole new install, following the Converting a “Traditional” WordPress Blog to a Subversion Checkout steps but then I remembered the – -relocate flag for Subversion’s switch command and took that (better) route instead.  Here is what it looked like:

> sudo svn sw – -relocate http://svn.automattic.com/wordpress/tags/2.7.1/ http://core.svn.wordpress.org/tags/2.7.1/ .
> sudo svn sw http://core.svn.wordpress.org/tags/2.8/ .
U    wp-pass.php
U    wp-comments-post.php
U    wp-login.php[…] U    wp-admin/admin-footer.php
U    wp-admin/categories.php
U    wp-admin/themes.php
Updated to revision 11556.
>

Notice that the – -relocate flag only allows you to switch the repository, not the branch.  Thus there are two commands needed; the first to switch the base url and the second to perform the update to version 2.8.  This will of course hold true for any other version update.

[EDIT: My theme was striping the double hyphen needed to call the relocate flag, so I have edited the text to include a space between the two hyphens so that it shows up in the post; when you use this command you will need to remove that space – Thanks to Daniele Muscetta for catching that!]

Anyway – I hope this helps someone, if so please leave me a comment or drop me an email!

6 Comments

  1. Daniele Muscetta 14 June 2009 at 09:06 - Reply

    You just saved me.
    Pay attention though, that “relocate” has to be passed with a DOUBLE-HYPHEN:

    svn sw –relocate http://….

    (might it be that you wrote it correctly but the current theme strips it away?)

  2. Daniele Muscetta 14 June 2009 at 09:07 - Reply

    in fact it stripts it away, also in my comment.

    svn sw —-relocate http://… and so on..

  3. Chris Grundemann 14 June 2009 at 10:52 - Reply

    Sure enough it was being stripped – thanks for catching that – I fixed it in the post and added a quick explanation, thanks!

  4. KattyBlackyard 14 June 2009 at 19:29 - Reply

    I really like your post. Does it copyright protected?

  5. Chris Grundemann 14 June 2009 at 20:25 - Reply

    All of my posts are licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/

  6. LS 26 June 2009 at 17:43 - Reply

    I just did it the lazy way — without relocating — and hit two conflicts (in the default theme, of all places). Not a serious problem, but I wonder (1) has this happened to others? and (2) how was this conflict introduced?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.