========================
 Upgrading to Turba 2.x
========================

:Last update:   $Date: 2005/04/13 15:21:37 $
:Revision:      $Revision: 1.5 $
:Contact:       turba@lists.horde.org


========================
 Upgrading to Turba 2.0
========================


These are notes on upgrading from Turba 2.0.x to Turba 2.1.

.. Important:: These upgrade instructions assume that you are upgrading from
               at least Turba 2.0.  If you have an older version of Turba,
               follow the 'upgrade steps'_ described in Turba 1.2, 2.0 or higher
               first.


New Hook Parameters
===================

The _turba_hook_encode_{attribute} and _turba_hook_decode_{attribute}
functions are now passed an additional parameter - the object that is
being loaded/saved. This enables you to create more powerful custom
hooks that build a field from several other field's values (the
opposite of composite fields), or otherwise modify a value based on
other properties of the object.


========================
 Upgrading to Turba 2.0
========================


These are instructions to upgrade from Turba 1.2.x to Turba 2.0.  Please
backup your existing data before running any of the steps described below.
You can't use the updated data with your old Turba version anymore.

.. Important:: These upgrade instructions assume that you are upgrading from
               at least Turba 1.2.  If you have an older version of Turba,
               follow the 'upgrade steps'_ described in Turba 1.2 or higher
               first.

.. _'upgrade steps': http://cvs.horde.org/annotate.php/turba/docs/Attic/UPDATE?sa=1&rev=1.1.2.6


SQL Backends
============

Four new fields have been added to the default SQL table layout, one being
mandatory.  The new ``object_uid`` field provides a global unique ID to
objects.

Execute the provided SQL script to update your data to the new Turba version::

   mysql --user=root --password=<MySQL-root-password> <db name> < 1.2_to_2.0.sql
   psql <db name> -f 1.2_to_2.0.sql


History
=======

The contacts history is now being maintained by the global Horde History
backend.  To create default history entries execute the provided PHP script::

   php scripts/upgrades/2004-10-26_create_default_histories.php
