[horde] Preference backend migration?

Jan Schneider jan at horde.org
Tue Apr 5 14:53:25 UTC 2011


Zitat von Adam Tauno Williams <awilliam at whitemice.org>:

> On Tue, 2011-04-05 at 15:24 +0200, Jan Schneider wrote:
>> Zitat von Adam Tauno Williams <awilliam at whitemice.org>:
>> > Is there a feature/trick/hack to migrate user preferences from one
>> > backend to another?  Perhaps using one of the hooks?
>> > Currently we use LDAP for preferences [since we use a lovely OpenLDAP
>> > server] but are moving to AD [when schema mods are less encouraged].
>> > I'd just like to continue using OpenLDAP to store the user prefs for
>> > awhile but write the preferences to the SQL database, and then at some
>> > point cut over to using that to read preferences.  Possible?
>> Not without some custom code development in the preference code. Or
>> maybe a postauthenticate hook would work too.
>
> That is what I suspected [inserting it into a hook];  I'm surprised
> nobody has run up against this before.
>
>> Of course you could also
>> write some customs script that does a one-time conversion directly
>> from one backend to the other.
>
>  - for each user
>    - 1. Create an Prefs_ldap object
>    - 2. Create an Prefs_sql
>      - 2.1. for each scope in [ 'horde', 'imp', 'turba', 'ingo',
>                            'mnemo', 'nag' ]
>        - 2.2. for each preference
>           - 2.2.1. ldap get
>           - 2.2.2. sql set
>
> My failure is at 2.1;  I don't see a method whereby one enumerates all
> the set defaults (just get-a-specific-default.).

Because it's not possible. That's why I suggest to directly manipulate  
the storage backends, i.e. not using any horde API at all.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the horde mailing list