Feb 6
Sweet
icon1 Niklas | icon2 Tags: , , . | icon4 02 6th, 2008| icon3No Comments »

Did I mention upgrading WP is now completely painless:

$ svn propset svn:externals "wp http://svn.automattic.com/wordpress/tags/2.3.3" .
property 'svn:externals' set on '.'

$ svn up

Fetching external item into 'wp'
U    wp/wp-includes/gettext.php
U    wp/wp-includes/version.php
U    wp/wp-includes/pluggable.php
U    wp/xmlrpc.php
U    wp/wp-admin/install-helper.php
Updated external to revision 6736.

Fetching external item into 'wp-plugins/openid'
Updated external to revision 30920.

Fetching external item into 'wp-plugins/akismet'
U    wp-plugins/akismet/akismet.php
Updated external to revision 30920.

Updated to revision 292.

$ svn -m "Upgrade to WP 2.3.3" commit .
Sending        .
Transmitting file data ..
Committed revision 293.

Technorati Tags: ,

Dec 26

Is this thing on? protocol7 has been broken for a few days due to an upgrade at my hosting and me being lazy over the holidays and not reporting it. Now, the Joyent support has fixed it and we should be back online.

This event reminded me that I needed to revisit my site configuration. I keep the entire site (except for the stuff that MySQL stores for me) in Subversion. The live site is simply a checked out working copy. Whenever I need to make an update, I do that locally on my laptop and commit the change to SVN. Then run a simple svn up on my server and it’s all done. This setup gives me a lot of confidence in knowing that all changes are safely stored and I can easily retrieve old working versions to rollback any bad update. In this case, this helped me a lot since one of the problems was a file that was mysteriously missing on the live site. svn up fixed that immediately.

I’ve also used the SVN installation method for Wordpress. However, my customizations has been troublesome. Since SVN can not handle overlapping working copies, the files below the WP checkout could not be stored in my SVN. This included my themes and plugins, the files that I spend most time on customizing. No good.

Today I spent some time on fixing this. Please note that I know next to nothing about PHP.

WP installation

I now include WP automatically in my checkout using the svn:externals property. This means, that wherever I check out the site, SVN will pull down the version of WP I currently run.
svn propset svn:externals "wp http://svn.automattic.com/wordpress/tags/2.3.1"

Plugins

Plugins are normally kept in wp-content/plugins beneath the WP installation. Again, this means I can not store these in my SVN. However, the plugins directory can be customized by setting the PLUGINDIR variable. Create a directory in your site root wp-plugins and put this in your wp-config.php:
define('PLUGINDIR', '../wp-plugins'); // no leading slash, no trailing slash

Then, put all your plugins in wp-plugins and store them in SVN like normal. I pull down any plugin I can using svn:externals, currently Akismet and the OpenID plugin.

Themes

Themes are normally stored in wp-content/themes. To customize this path, you need to use a different method from plugins. The idea is to use add_filter to create a filter that changes the path. However, there are currently some issues with this approach (for example image paths in the WP admin GUI not using the filtered paths but instead handcrafting them) so I had to use a workaround. I’ve created a wp-themes directory in the site root, put my themes in it and stored it in SVN. Then, I create soft links using ln -s to link the themes into wp-content/themes. I’ll continue investigating this issue with the WP developers to see if a better solution is possible.

wp-config.php

wp-config.php must be kept under the WP installation directory. Again, I use soft links to keep my original copy in a custom directory and under SVN control. Note that as part of wp-config.php, WP detects its installation directory. When using a soft link, it will find the wrong root directory. Instead, I have changed wp-config.php to set the correct root directory explicitly:
define('ABSPATH', '/absolute/path/to/wp/');

Again, not exactly what you would like, but does the work.

Site installation

Installing or restoring the site can now be done using the following commands
svn checkout http://example.com/my/svn/repos .
ln -s wp-themes/mytheme wp/wp-content/themes/mytheme
ln -s wp-custom/wp-config.php wp/wp-config.php

Upgrading WP is done by changing the svn:externals property and then running svn up. Dead simple.

Technorati Tags: , ,

Oct 27

I just upgraded my Wordpress installation (the one used to publish this post) to the latest 2.3.1. Upgrading WP is easy, but boring so this time I decided on putting some additional work into the upgrade by switching to the SVN based install described here. Worked like a charm and future updates should now be as easy as running svn switch. I keep the rest of my site in my private SVN since a few years back. That means I would like to keep my WP customizations (like wp-config.php, plugins and themes) in my own SVN and then interleave their working copies to make up the final site. Haven’t yet figured out how to best do this. Tried soft linking my custom files into the WP checkout, but that blew up WP.

May 16
OpenID broken here
icon1 Niklas | icon2 Tags: , . | icon4 05 16th, 2007| icon3No Comments »

Seems like my new Wordpress theme broke the OpenID form controls. I’ll do some theme wrestling after the weekend.

May 9
Disabled del.icio.us
icon1 Niklas | icon2 Tags: , . | icon4 05 9th, 2007| icon31 Comment »

Inspired by Mårten and Mark Baker I’ve just disabled my del.icio.us posts here at protocol7. Like Mark, they mostly served as an excuse for me not to write real posts. If you still want them, they are over here.

Tags: ,

Oct 27
Hemingway
icon1 Niklas | icon2 Tags: , . | icon4 10 27th, 2006| icon3No Comments »

Say hello to Hemingway, my new blog theme. Pretty happy with the vanilla theme and with an hour or so of hackery it’s getting really close to what I want. Some smallish things left (like to many quicklinks in the menu pane) to fix but that’s for another day.

Aug 1
The move to TextDrive
icon1 Niklas | icon2 Tags: . | icon4 08 1st, 2006| icon3No Comments »

As posted yesterday, I’ve just moved protocol7 to a now hosting at TextDrive. The primary reason for this was to get support for SubVersion hosting, shell access and cron jobs. I was expecting a lot a trouble with DNSes, stuff gone wrong with the move of content. But, much to my surprise everything worked out very good. For me, DNS got updated in less than five minutes after which everything, besides a missing .htaccess file worked flawlessly.

So far I’m very happy with TextDrive, it’s been working good, they are very transperent when it comes to any issues they have with the servers and the support has been efficient. In this migration I also switched domain hosting to GoDaddy (from the company of-which-will-not-be-spoken). Their online tools to administer my domain also has worked out great.

All in all, a simple and successful migration.

Jul 31
DNS test post
icon1 Niklas | icon2 Tags: . | icon4 07 31st, 2006| icon3No Comments »

This is just a test post to tell me when DNSes has been updated. Moving to TextDrive.

Sep 7
Mint
icon1 Niklas | icon2 Tags: . | icon4 09 7th, 2005| icon3No Comments »

I immediatelly fell for the pressure and bought Mint, the hyped site statistics app from Shaun Inman. Bought (via PayPal), downloaded and installed, all within five minutes. So far I’ve only used it for an hour so it’s way to early to tell how it will work out but here are some intial reflections.

The AJAX based GUI is very slick. I would like to be able to provide links to the individual portlets.

Pepper, the plugin interface is easy to use. I installed the UserAgent 007 plugin in less than a minute and it instantly started collecting data.

Now, its going to be interesting to see if a plugin community evolves around Mint.

Feb 24
Moved to WordPress
icon1 Niklas | icon2 Tags: , . | icon4 02 24th, 2005| icon3No Comments »

With the release of WordPress 1.5 I couldn’t resist any longer. I made the switch from Movable Type a few days ago. Installation was very simple (<5 minutes), import of all my MT entries was trivial using the import-mt.php script (<5 minutes), setting up the permalinks (1 hours) and redesign of my Kubrick based MT templates was simple since the default theme in WP is also Kubrick (30 minutes). All in all the switch took about two hours and all has been working very good since.

I can strongly recommend doing this switch, if nothing for nothing else to enjoy the powerful but simple admin GUI.

« Previous Entries