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

:Last update:   $Date: 2006/09/27 14:53:15 $
:Revision:      $Revision: 1.3.6.7 $
: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 `Upgrading to Turba 2.0`_
               first.

Synchronization support
-----------------------

Synchronization with SyncML capable devices is possible now if you have at
least Horde 3.1.  You need to create a History backend with
``horde/scripts/sql/horde_histories.sql`` to allow synchronization.  You also
need to create default history entries for existing contacts by running the
script ``scripts/upgrades/create_default_histories.php``.


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.


Share Support
-------------

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 share that is viewable by all users.  If you choose not to
use shares, 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.

.. Important:: If you are currently using two seperate ``turba_objects`` tables
               - one for personal address books and one for a public address
               book, you should run the upgrade script on the public table,
               then merge the public table into the private table and enable
               share support on the private table.  There is no longer any
               need for maintaining the two seperate tables. If you desire not
               to enable share support, you may still use seperate tables and
               set permissions via the administration interface.


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 `Upgrading to Turba 1.2`_
               first.


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/create_default_histories.php


Upgrading to Turba 1.2
======================

These are instructions to upgrade from Turba 1.1 to Turba 1.2.  Please backup
your existing data before running any of the steps described below.  You will
no longer be able to use your data with older versions of Turba.


SQL Backends
------------

The SQL schema for the SQL address book has changed. Please update your SQL
table to the new schema after you update to Turba 1.2.  The fields
``object_type`` and ``object_members`` have been added (needed for
distribution lists) and the fields ``object_homeaddress``,
``object_workaddress``, ``object_homephone``, ``object_workphone`` and
``object_cellphone`` have changed to all lowercase.

If you are using a MySQL or PostgreSQL database you can also use the update
script available in ``scripts/upgrades/1.1_to_1.2.sql``.


LDAP Backends
-------------

The LDAP schema for the shared LDAP address book has changed. Please update
your LDAP directory to use the new schema after you update to Turba 1.2, and
also update ``config/sources.php`` accordingly.

The ``objectclass`` entry for LDAP address book definitions in
``config/sources.php`` is respected in Turba 1.2 but wasn't before, so you
should make sure that you use a correct setting here.


IMP Integration
---------------

If you were using IMP_ 3.1 you should also upgrade to IMP 3.2; distribution
list support in Turba 1.2/IMP 3.2 is not compatible with how the contacts
window in IMP 3.1 worked. However, IMP 3.0 did not have this window, and will
probably play nicely with Turba 1.2.

.. _IMP: http://www.horde.org/imp/
