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

:Last update:   $Date: 2005/10/18 12:50:04 $
:Revision:      $Revision: 1.3.6.2 $
:Contact:       turba@lists.horde.org


Upgrading to Turba 2.1
======================


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.


Horde_Share Support
-------------------

Horde_Share support has been added to Turba.  This allows the sharing, adding,
and deleting of addressbooks for those sources that support it.  Currently,
this is supported by the SQL driver.  With this change, the 'public' attribute
of the params array has been removed in favor of the 'use_share' attribute.
If you are currently using a SQL source as a public source, you must run the
upgrade script scripts/upgrades/public_to_horde_share.php.  Be sure to read
the script comments and backup all data before conversion.  This script will
create a new Horde_Share that is viewable by all users.  If you choose not to
use Horde_Share, set the 'use_shares' attribute to 'false' and the SQL driver
will behave as in previous versions, that is, a seperate, private addressbook
for each user.



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
