Introduction About Habari What's New Installation Upgrading Using Habari Developer Introduction

Upgrading

Before You Upgrade

Before making any major change in your Habari installation, it would be prudent to create a backup of your database and your installation, in particular all the files in your Habari /user directory. The /user directory should contain all files which you have customized - plugins you have installed, themes you have installed, class files you may have modified, or locale files you have installed.

The Upgrade Process

  1. Download the new version of Habari that you will be installing. Unzip it into the location of your choice.
  2. Deactivate your active plugins. Some of the system plugins may have been changed. Some of the plugins you got in other places may not be compatible with the new version of Habari.
  3. Delete the following directories
    1. /3rdparty
    2. /scripts
    3. /doc
    4. /system
  4. Delete the index.php, LICENSE, and NOTICE files from the root of your installation. Do not delete your config.php file if it is in the root of your Habari installation, or the .htaccess file.
  5. Copy the new version of Habari to the same location as the old version.
  6. Using your web browser, navigate to your site. If there are any database changes that need to be made, they will be made automatically at this time.
  7. Log into your Habari administrative area. Navigate to the plugins page and reactivate the plugins one by one.
  8. Celebrate and enjoy the new features of your latest version of Habari!

Upgrading from Version 0.5.2 to Version 0.6

Version 0.6 incorporates many changes from the previous version, both in bug fixes and new features. For details see the release notes.

Habari's upgrade process is designed to be transparent, with the only indication that an upgrade is happening being a slightly longer page load time the first time the site is visited after the software is updated.

One major change that affects the upgrade process in this release is in how Habari stores it's configuration details. Habari 0.5.2 and earlier stored site configuration details in global variables. Habari 0.6 marks the move to using a config class, so the variables aren't globally available, a change that was made to improve security. These details are stored in the site's config.php file, which is located either in the root of the site's directory, or, for multisite users, in Habari's /user/sites/site_name directory.

For users who have left their config.php file writable, the necessary changes to the configuration file will be handled by the upgrade process transparently. For users who have made their configuration file read only, some manual changes will have to be made before the upgrade process can begin.

Manually Updating The Configuration File

The config.php file for Habari version 0.5.2 and below looks like this:

For MySQL

<?php
$db_connection= array(
	'connection_string'=>'mysql:host={$db_host};dbname={$db_schema}',
	'username'=>'{$db_user}',
	'password'=>'{$db_pass}',
	'prefix'=>'{$table_prefix}'
);

?>

For SQLite

<?php
$db_connection= array(
	'connection_string'=>'sqlite:{$db_file}',
	'username'=>'',
	'password'=>'',
	'prefix'=>'{$table_prefix}'
);

?>

With version 0.6 and forward the config file looks like this:

For MySQL

<?php
Config::set( 'db_connection', array(
	'connection_string'=>'mysql:host={$db_host};dbname={$db_schema}',
	'username'=>'{$db_user}',
	'password'=>'{$db_pass}',
	'prefix'=>'{$table_prefix}'
));

?>

For SQLite


<?php
Config::set( 'db_connection', array(
	'connection_string'=>'sqlite:{$db_file}',
	'username'=>'',
	'password'=>'',
	'prefix'=>'{$table_prefix}'
));

?>

The easiest thing to do is, before upgrading, make the configuration file writable. Perform the upgrade, then make the file read only again.

If you don't wish to do that, open the configuration file in a text editor and make the changes shown above, save your changes, then navigate to your site so the upgrade process can proceed.

Upgrading Other Versions of Habari

For specific upgrade instructions for earlier versions of Habari, see the full upgrade notes on the wiki.