Upgrading to WordPress 2.2.1

WordPress

I have just upgraded our blog engine from WordPress 2.1.something to the latest 2.2.1 version. It was very straightforward.

First of all I backed up everything by:

  • Creating a tarball of the current site: tar zcf wordpress_dir_backup.tar.gz /.../blog_directory
  • Backing up the WordPress database: mysqldump -u dbuser -p dbname > wordpress_db_backup.dump.sql

After I verifying the backup was O.K. I then extracted the wordpress.2.2.1.zip archive straight over the top of the current installation. This retained our configuration files and custom theme. I also did a quick chown -R web_user:web_group blog_directory to ensure all the files were owned by the webserver. Then you point your browser at (in our case) http://www.theopensourcerer.com/wp-admin/upgrade.php to upgrade the database.

That was it. A quick check over and everything seemed to be fine.

Now, the main reason for wanting to upgrade was to be able to use “widgets“. But unfortunately our theme (a slightly modified version of the lovely blueflower-0.5) was not widget aware. However, after reading this for a few minutes, it was a very trivial task to make it so…

It turned out that simply by adding the following line of php to the functions.php file made our sidebar widgetised. (To actually edit the file use the “Presentation > Theme Editor” menu and select the functions.php file from the list on the right hand side. If your theme doesn’t have a functions.php file refer back to this page for details of how to make one.)

if ( function_exists('register_sidebar') )
register_sidebar();

I added this line after the initial comments but before the rest of the existing php code in the file. Now all the information in the left sidebar can be generated by the widget library. You configure the sidebar in the “Presentation > Widgets” screen of the admininstration system.

Hopefully this information will help someone else too.

« Previous Page