1 (edited by neozimpi@gmail.com 2015-04-02 21:01:18)

Topic: Migrate from LDAP to MYSQL

==== Required information ====
- iRedMail version: v0.4.1 (LDAP)
- Store mail accounts in which backend : LDAP
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: Debian GNU/Linux 7.8 (wheezy)
- Related log if you're reporting an issue: x
====

I installed the mail server using LDAP for multiple reasons or other projects.
In the meantime everything changed and i have to switch from LDAP to MYSQL.

Is there a way to migrate from LDAP to MYSQL. The Server is in full service 24/7.
and i have to work quick if do any maintenance. So i hoep tha there are tools to do that.

The person who worked with ldap is not here anymore so i am at my own.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Migrate from LDAP to MYSQL

*) Why do you have to switch from LDAP to MySQL?
*) To switch from MySQL, the most important things are:

- Keep passwords.
- Keep same maildir directory structure.

Both 2 are easy if you're familiar with where these info are stored. I suggest you setup a virtual machine with MySQL backend for testing, should be easy to migrate. And of course it requires you to write some simple shell/python script to export some data from LDAP server.

*) For password, please check this tutorial:
http://www.iredmail.org/docs/password.hashes.html

Passwords for ldap are stored in SSHA by default, you can copy them directly and store them in SQL column "mailbox.password".

*) Maildir path are stored in LDAP attribute 'homeDirectory' of user object, and must be splited 3 columns in SQL backend: mailbox.storagebasedirectory, mailbox.storagenode, mailbox.maildir.

By the way, i offer paid support for migration if you want. You can contact me here: http://www.iredmail.org/contact.html

3

Re: Migrate from LDAP to MYSQL

The problem is i have never worked with LDAP and MYSQL is heavily used here. Also i have no
clue how to recover LDAP.

My second info what i got is that L_DAP is obsolete and is slower.

But it looks like LDAP has its advantages.
Thanks for the insight so far.

4

Re: Migrate from LDAP to MYSQL

neozimpi@ wrote:

The problem is i have never worked with LDAP and MYSQL is heavily used here. Also i have no
clue how to recover LDAP.

We have a short tutorial to show you how to backup/restore LDAP data on iRedMail server:
http://www.iredmail.org/wiki/index.php? … FAQ/Backup

And below are detailed documents to learn OpenLDAP if you're willing to:

- Official OpenLDAP Admin Guide: http://www.openldap.org/doc/admin24/
- A great book: http://www.zytrax.com/books/ldap/

neozimpi@ wrote:

My second info what i got is that L_DAP is obsolete and is slower.
But it looks like LDAP has its advantages.

aha, LDAP is not obsolete, and it's not slow. LDAP protocol is optimized for read access, but it's a little slower for write access -- compare to SQL database.

In iRedMail with OpenLDAP backend, OpenLDAP is used to store mail accounts, this is a good use case for using LDAP. because Postfix/Dovecot and other softwares read/query LDAP server a lot, but almost no write access.

If MySQL service is in heavy use on your server, maybe it's a good idea to store mail accounts in LDAP in your case -- to reduce read access to SQL server.

5

Re: Migrate from LDAP to MYSQL

I will keep that in mind and let it be that way.
Thanks for the overview and explanation.