6.0.0-git
2022-12-03

Diff for GroupLdapMigration between 2 and 3

+ Migrating an existing horde installation's group from SQL to LDAP

++ Manually
I strongly suggest you don't play around in production!

+++ Basics
- Configure a separate vhost each for the db-based and the sql-based setup
- create conf-{sqlvhost}.host.com.php and conf-{ldapvhost}.host.com.php each containing only the php tag and all $conf['group'] stuff. 
- use the docs on how to setup horde for ldap groups.
- ensure both are basically working (create some bogus group and add some user in each backend)
- Now open https://{host}/horde/admin/groups.php or  https://{host}/admin/groups.php in each site.
- Create all the missing groups in the ldap backend. add all the missing users.

+++ Permissions
(assuming SQL backend) select * from horde_perms where perm_data like "%groups%";

Each permission assigned to a group by numeric group id must be cloned to be used by the ldap group backend.
Best use the group admin screen.

Do not attempt to edit the perms using an sql statement. 

+++ Shares
(assuming sharesng sql backend is used)
Find any apps using sharesng shares
mysql> show tables like "%sharesng_groups%";

For each found table, 

For each group_uid which is numeric, look up the group name
mysql> select group_nameand build a query to create a corresponding entry with the same perms.

++++ KRONOLITH

select DISTINCT CONCAT(
"INSERT INTO kronolith_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
", ",
perm_1024,
");"
) 
as query from kronolith_sharesng_groups, horde_groups where group_uid=N;
WHERE kronolith_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND kronolith_sharesng_groups.group_uid=horde_groups.group_uid;


++++ NAG

select DISTINCT CONCAT(
"INSERT INTO nag_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
");"
) 
as query from nag_sharesng_groups, horde_groups 
WHERE nag_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND nag_sharesng_groups.group_uid=horde_groups.group_uid;

++++ ansel

select DISTINCT CONCAT(
"INSERT INTO ansel_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
");"
) 
as query from ansel_sharesng_groups, horde_groups 
WHERE ansel_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND ansel_sharesng_groups.group_uid=horde_groups.group_uid;


++++ gollem


select DISTINCT CONCAT(
"INSERT INTO gollem_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
");"
) 
as query from gollem_sharesng_groups, horde_groups 
WHERE gollem_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND gollem_sharesng_groups.group_uid=horde_groups.group_uid;

++++ ingo

select DISTINCT CONCAT(
"INSERT INTO ingo_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
");"
) 
as query from ingo_sharesng_groups, horde_groups 
WHERE ingo_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND ingo_sharesng_groups.group_uid=horde_groups.group_uid;

++++ mnemo

select DISTINCT CONCAT(
"INSERT INTO mnemo_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
");"
) 
as query from mnemo_sharesng_groups, horde_groups 
WHERE mnemo_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND mnemo_sharesng_groups.group_uid=horde_groups.group_uid;


++++ turba 

select DISTINCT CONCAT(
"INSERT INTO turba_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
");"
) 
as query from turba_sharesng_groups, horde_groups 
WHERE turba_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND turba_sharesng_groups.group_uid=horde_groups.group_uid;

++++ whups

select DISTINCT CONCAT(
"INSERT INTO whups_sharesng_groups VALUES(",
share_id,
", \"cn=",
horde_groups.group_name,
",ou=hordegroups,dc=domain,dc=com\"",
", ",
perm_2,
", ",
perm_4,
", ",
perm_8,
", ",
perm_16,
");"
) 
as query from whups_sharesng_groups, horde_groups 
WHERE whups_sharesng_groups.group_uid REGEXP "^^[0-9]+$" 
AND whups_sharesng_groups.group_uid=horde_groups.group_uid;

Find the corresponding ldap group id, for example
GroupName,ou=hordegroups,dc=domain,dc=com

Create a corresponding entry with the same perms.


+++ Cache

Clear horde group cache and horde shares cache once you're done.


++ By script

TBD