\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
\part{Migrating an existing horde installation's group from SQL to LDAP}
\section{Manually}
I strongly suggest you don't play around in production!

\subsection{Basics}
\begin{itemize}
\item Configure a separate vhost each for the db-based and the sql-based setup


\item create conf-\{sqlvhost\}.host.com.php and conf-\{ldapvhost\}.host.com.php each containing only the php tag and all \$conf['group'] stuff.


\item use the docs on how to setup horde for ldap groups.


\item ensure both are basically working (create some bogus group and add some user in each backend)


\item Now open <a href="https://\{host\}/horde/admin/groups.php">https://\textbackslash\{\}\{host\textbackslash\{\}\}/horde/admin/groups.php</a> or  <a href="https://\{host\}/admin/groups.php">https://\textbackslash\{\}\{host\textbackslash\{\}\}/admin/groups.php</a> in each site.


\item Create all the missing groups in the ldap backend. add all the missing users.


\end{itemize}
\subsection{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.<br />
Best use the group admin screen.

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

\subsection{Shares}
(assuming sharesng sql backend is used)<br />
Find any apps using sharesng shares<br />
mysql> show tables like "\%sharesng\_groups\%";

For each found table,

For each group\_uid which is numeric, look up the group name<br />
and build a query to create a corresponding entry with the same perms.

\subsubsection{KRONOLITH}
select DISTINCT CONCAT(<br />
"INSERT INTO kronolith\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
", ",<br />
perm\_1024,<br />
");"<br />
)<br />
as query from kronolith\_sharesng\_groups, horde\_groups<br />
WHERE kronolith\_sharesng\_groups.group\_uid REGEXP "<sup>[0-9]+\$"<br />
AND kronolith\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

++++ NAG

select DISTINCT CONCAT(<br />
"INSERT INTO nag\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
");"<br />
)<br />
as query from nag\_sharesng\_groups, horde\_groups<br />
WHERE nag\_sharesng\_groups.group\_uid REGEXP "</sup>[0-9]+\$"<br />
AND nag\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

\subsubsection{ansel}
select DISTINCT CONCAT(<br />
"INSERT INTO ansel\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
");"<br />
)<br />
as query from ansel\_sharesng\_groups, horde\_groups<br />
WHERE ansel\_sharesng\_groups.group\_uid REGEXP "<sup>[0-9]+\$"<br />
AND ansel\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

++++ gollem

select DISTINCT CONCAT(<br />
"INSERT INTO gollem\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
");"<br />
)<br />
as query from gollem\_sharesng\_groups, horde\_groups<br />
WHERE gollem\_sharesng\_groups.group\_uid REGEXP "</sup>[0-9]+\$"<br />
AND gollem\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

\subsubsection{ingo}
select DISTINCT CONCAT(<br />
"INSERT INTO ingo\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
");"<br />
)<br />
as query from ingo\_sharesng\_groups, horde\_groups<br />
WHERE ingo\_sharesng\_groups.group\_uid REGEXP "<sup>[0-9]+\$"<br />
AND ingo\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

++++ mnemo

select DISTINCT CONCAT(<br />
"INSERT INTO mnemo\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
");"<br />
)<br />
as query from mnemo\_sharesng\_groups, horde\_groups<br />
WHERE mnemo\_sharesng\_groups.group\_uid REGEXP "</sup>[0-9]+\$"<br />
AND mnemo\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

\subsubsection{turba}
select DISTINCT CONCAT(<br />
"INSERT INTO turba\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
");"<br />
)<br />
as query from turba\_sharesng\_groups, horde\_groups<br />
WHERE turba\_sharesng\_groups.group\_uid REGEXP "<sup>[0-9]+\$"<br />
AND turba\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

++++ whups

select DISTINCT CONCAT(<br />
"INSERT INTO whups\_sharesng\_groups VALUES(",<br />
share\_id,<br />
", \textbackslash\{\}"cn=",<br />
horde\_groups.group\_name,<br />
",ou=hordegroups,dc=domain,dc=com\textbackslash\{\}"",<br />
", ",<br />
perm\_2,<br />
", ",<br />
perm\_4,<br />
", ",<br />
perm\_8,<br />
", ",<br />
perm\_16,<br />
");"<br />
)<br />
as query from whups\_sharesng\_groups, horde\_groups<br />
WHERE whups\_sharesng\_groups.group\_uid REGEXP "</sup>[0-9]+\$"<br />
AND whups\_sharesng\_groups.group\_uid=horde\_groups.group\_uid;

\subsection{Cache}
Clear horde group cache and horde shares cache once you're done.

\section{By script}
TBD

\end{document}
