How to use SVN to update WordPress
Making it Work
If you wish, put up an .htaccess to redirect all requests for your blog to a construction page. But frankly, your blog will be down for such a short period of time that I don’t think it’s worth it.
- Log in via SSH and
cdto your root directory. It is usually calledpublic_htmlorwww. (See Basic Linux Commands to get a handle oncd,ls,mv,cp, andrm.) - Issue the
lscommand to make sure you can see your blog directory. I will assume it is called blog. If you see your blog, good. You’re in the right directory. - Issue the command
mv blog/ blog.bak/to move your (working) blog to a backup directory. If something goes wrong, you’ll have a working copy to restore to. - Now make a new blog directory and move into it with the command
mkdir blog && cd blog. - You’re ready to check out a fresh copy of WordPress. The current SVN command to use, as found on the WordPress SVN page, is:
svn co http://svn.automattic.com/wordpress/trunk/ ./
cd ../blog.bak/will move you into your old (working) blog. If you’ve done things right, you should only have a few files to move.cp wp-config.php ../blog/for your config file.cp -R wp-content/themes/yourtheme/ ../blog/wp-content/themes/will copy your custom theme over. Notice the -R switch, which is needed to copy a directory.cp wp-content/plugins/yourplugin.php ../blog/wp-content/plugins/for each plugin you have.
You should now have a working WordPress install, from SVN, completely up-to-date.
The next time a WordPress update is released, cd to your blog’s folder and issue the command svn up and WordPress will automatically be updated to the latest version! That time savings makes setting up SVN completely worthwhile.
11:16 am
Nice guide Seth, very helpful!
Only problem is, I got as far as the first step on the second page, until it told me Shell access is not enabled on this account so I couldn’t carry on :S
11:26 am
I’ll enable it for your account now.
12:55 pm
Excellent! It’s so much quicker and easier.
Thanks a lot for writing this, it cetainly helped me out ^_^
8:58 pm
[...] I’m sorry, WordPress is as only as good as the folks messing around with the innards. So it’s damn good. Since the inception of this crappy little blog that barely anyone visits, I’ve been using Subversion to manually update the blog to the latest and greatest version of WordPress being crafted for the masses. So I’m pretty happy about the ease with which I’m able to bring things up to speed and take advantage of what’s cooking with the crafty contributors to WordPress. [...]
3:05 pm
[...] How to use SVN to update WordPress [...]
11:52 am
[...] Updating Wordpress via SVN is about a million times easier than updating it the old way. [...]
3:14 am
[...] installation. I recommend reading the more detailed page on the Wordpress site, and both pages of Seth Kinast’s entry on the [...]
12:57 am
Cool!