[turba] creating entries

Michael Rubinsky mike at theupstairsroom.com
Thu Feb 22 16:49:59 PST 2007


Kevin Conley wrote:
> I am trying to migrate from a previous webmail program - EMUMail - and 
> its address book is very ugly - they are in perl gdbm format.
>
> So i wrote a script to get the values out but then looking at the 
> turba_objects table it seems obvious how to map the entry fields 
> except...
>
> How is the object_id and object_uid generated?

They are generated by the specific backend drivers when an entry is 
added.  The object_id is used as a key, unique to your horde install 
only, while the object_uid is used with the syncml code and is globally 
unique.  In the case of the SQL driver, I believe the _id is generated 
something like

<code>
$id = md5(uniqid(mt_rand(), true));
</code>

while the _uid is something like

<code>
$uid = date('YmdHis') . '.' . substr(base_convert(microtime(), 10, 36), 
-16) . '@' . $GLOBALS['conf']['server']['name'];
</code>

Where $GLOBALS['conf']['server']['name'] would, obviously, be the host 
name of your server.

I remember a thread on this some time ago on the turba list. A search of 
the archives should turn something up...


>
> Do they have to be generated in the context of the turba application 
> or can i calcluatel them myself so my perl import script can do raw 
> sql calls right into the turba_objects table?

You should be able to create them yourself although I'm not 100% sure if 
doing it this way (without creating horde_histories table entries) will 
affect syncing...

-- 
Thanks,
Mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org



More information about the turba mailing list