[turba] Flatten shares script failing (upgrading)

Cahva cahva at po-rno.fi
Sat Mar 28 15:45:26 UTC 2009


Patrick Boutilier kirjoitti:
> Cahva wrote:
>> Patrick Boutilier kirjoitti:
>>> Cahva wrote:
>>>> Jan Schneider kirjoitti:
>>>>> Zitat von Markku Virtanen <cahva at po-rno.fi>:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> We have installed the latest Horde webmail edition and transformed 
>>>>>> old horde/turba/etc. database to new one. Only problem we have 
>>>>>> right now is that additional addressbooks dont work for ous 
>>>>>> customers and we need to run 2007-06-17_flatten_shares.php script 
>>>>>> but unfortunately it doesnt work. Error is:
>>>>>>
>>>>>> Fatal error: Call to a member function getAssoc() on a non-object 
>>>>>> in ***/horde/turba/scripts/upgrades/2007-06-17_flatten_shares.php 
>>>>>> on line 53
>>>>>>
>>>>>> This is (sort of)the same problem that was here:
>>>>>> http://osdir.com/ml/horde.turba/2008-01/msg00002.html
>>>>>>
>>>>>> But offcourse script is the updated version already.
>>>>>>
>>>>>> Little debugging shows that line:
>>>>>> $datatree = $turba_shares->_datatree;
>>>>>>
>>>>>> var_dump($datatree);
>>>>>>
>>>>>> ..it gives NULL
>>>>>>
>>>>>>
>>>>>> Database schema and other upgrades have been done so I think maybe 
>>>>>> there has been some changes in the underlying code that breaks 
>>>>>> this upgrade script. Any thoughts?
>>>>>
>>>>> You have to run the flatten shares script *before* migration shares 
>>>>> from datatree to sql.
>>>>>
>>>>> Jan.
>>>>>
>>>>
>>>> Thanks for the answer but it does that even when I havent ran the 
>>>> other upgrades yet.
>>>>
>>>> The next is done with a fresh install of horde-webmail-1.2.2.
>>>>
>>>> I copied the relevant tables from the old webmail (turba_objects, 
>>>> datatree etc.), done the initial configs and then ran only the turba 
>>>> upgradescripts:
>>>>
>>>> turba/scripts/upgrades/2.1_to_2.2_sql_schema.php
>>>>
>>>> After that:
>>>> turba/scripts/upgrades/2007-06-17_flatten_shares.php
>>>>
>>>> ..it gives the same error that I gave earlier. What should 
>>>> $turba_shares->_datatree contain (which is now NULL)? I've tried to 
>>>> find  instances of _datatree in turba's code but couldnt find any..
>>>>
>>>>
>>>> Is this flatten script THE script that will get the additional 
>>>> addressbooks working?
>>>>
>>>> We did the whole webmail upgrade last monday and then I just checked 
>>>> that I had addresses in my own book so I assumed it had worked.
>>>>
>>>> I'm running out of ideas how to get those additional addressbooks to 
>>>> work so if someone could give any advice how to solve this, I would 
>>>> be very grateful..
>>>
>>>
>>> Is your horde configured to use the datatree? Something like this is 
>>> conf.php?
>>>
>>> $conf['datatree']['params']['driverconfig'] = 'horde';
>>> $conf['datatree']['driver'] = 'sql';
>>>
>>>
>>
>> Yes it is. The problem is that the way how data is stored has changed
>> since turba 2.1 and those additional addressbooks should be somehow
>> converted to new one and Im pretty sure its this flatten shares script
>> that does that but doesnt want to work right now.
> 
> What about $conf['share']['driver'] ? If it is set to sql instead of 
> datatree you will get the error on line 53.
> 
> Do you still have any address books in the datatree or have they all 
> been converted to the sql shares? I don't think you can flatten entries 
> that are already in the sql shares.
> 
> Proper sequence is to run 2007-06-17_flatten_shares.php then 
> convert_datatree_shares_to_sql.php
> 

Hey thats it! $conf['share']['driver'] was set to sql, not datatree.

I got the addressbooks to work now. Actually I went "back to basics" and
  copied the old webmail to new directory and made a copy of the
database which I then used for upgrade. Then I just updated turba. Then
copied the newly generated tables to the new server and voila, they
worked! :)

I think that the initial problem with the update was that we moved to
use the webmail edition straight. We installed that so it had the db
schema already created. Then we copied the old tables and ran the
upgrade scripts. Maybe we ran the upgrade scripts in wrong order..

Anyway, thanks to everyone who took the time to answer me!

--
Markku



More information about the turba mailing list