1

Topic: Emails migration from Plesk to IredMail

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
====Dear friends,

I'm using the iRedMail for few days and I'm very impressed with it. But now I'm planning to migrate some accounts and domains from an old server (around 30 domains and 100 accounts) to the new server with IRedMail. The old server run a Plesk 11 over a CentOS 5.8 and I'm using the "default" mail system provided by Plesk (and it's CentOS services).

I confess that I don't have idea about how can I move/copy/migrate the mail of my colleagues to the new server, including the address books of their accounts and for this I'm here asking for help.

If someone have a tutorial or some insights about how can I do it, I'm very happy.

Thank you.
Regards

==== Required information ====
- iRedMail version: lastest
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Debian Squeezy
- Related log if you're reporting an issue:
====

----

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

2

Re: Emails migration from Plesk to IredMail

*) If Plesk stores mails in Maildir format (each mail message is stored in one plain text file), you can simply copy them to iRedMail server.

*) If Plesk stores mail accounts in MySQL, you can dump them and format them to proper LDIF data used to import into LDAP server.

It would be great if you can show us more details about your current mail server, so that we can give you some more tips.

3

Re: Emails migration from Plesk to IredMail

Dear Zhang,

First of all, thanks for the second reply in my questions.

I'm migrating because Plesk is a mess (for me). Very fat, slow and I can't do what I need. Some stupid things like "change a password by Roundcube" is a challenge for everyone. Crazy stuff.

I found the emails at /var/qmail with this structure

/var/qmail/mailnames/<domain-name>/<user-name>

Inside of this path I found 2 directories:
drwx------ 2 popuser popuser 4096 Abr 29 20:44 @attachments
drwx------ 6 popuser popuser 4096 Abr 29 20:44 Maildir

Inside the Maildir (that I think it's the messages) I have:
drwx------ 2 popuser popuser 4096 Abr 29 20:44 cur
-rw-r--r-- 1 popuser popuser   31 Mai  2 17:51 maildirsize
drwx------ 2 popuser popuser 4096 Abr 29 20:44 new
drwx------ 2 popuser popuser 4096 Mai  2 17:51 tmp

Some users have this structure inside the Maildir directory:
drwx------ 2 popuser popuser 77824 Mai  3 11:03 courierimapkeywords
-rw-r--r-- 1 popuser popuser    12 Mar 27 15:55 courierimapsubscribed
-rw-r--r-- 1 popuser popuser 21893 Mai  3 10:57 courierimapuiddb
-rw-r--r-- 1 popuser popuser 13523 Mar 26 12:04 courierpop3dsizelist
drwx------ 2 popuser popuser 53248 Mai  3 11:03 cur
-rw-r--r-- 1 popuser popuser  2029 Mai 21 08:28 maildirsize
drwx------ 2 popuser popuser 20480 Mai 21 08:28 new
drwx------ 2 popuser popuser  4096 Mai 21 08:28 tmp

If you ask me about "where is the user account" I really don't know but, looking at the MySQL I found a Postfix database with these tables:

| admin                 
| alias                 
| alias_domain   
| config             
| domain           
| domain_admins
| fetchmail         
| log                 
| mailbox           
| quota             
| quota2           
| vacation         
| vacation_notification

Checking these tables, I can't see anything inside. All of them empty and for this, I think that the accounts are stored in another place.

Looking again the MySQL, I found another interesting table: roundcubedb with these tables:
| Tables_in_roundcubedb |
+-----------------------+
| cache                 
| cache_index           
| cache_messages       
| cache_thread         
| contactgroupmembers   
| contactgroups   
| contacts           
| dictionary         
| identities         
| searches           
| session             
| users                 

Here, I found a lot of data. The users table have a lot of users inside of this structure:

+-------------+------------------+------+-----+---------------------+----------------+
| Field       | Type             | Null | Key | Default             | Extra          |
+-------------+------------------+------+-----+---------------------+----------------+
| user_id     | int(10) unsigned | NO   | PRI | NULL                | auto_increment |
| username    | varchar(128)     | NO   | MUL | NULL                |                |
| mail_host   | varchar(128)     | NO   |     | NULL                |                |
| alias       | varchar(128)     | NO   | MUL | NULL                |                |
| created     | datetime         | NO   |     | 1000-01-01 00:00:00 |                |
| last_login  | datetime         | YES  |     | NULL                |                |
| language    | varchar(5)       | YES  |     | NULL                |                |
| preferences | text             | YES  |     | NULL                |                |
+-------------+------------------+------+-----+---------------------+----------------+

Also, inside of contacts table I found the user's contacts (I think). This table have this structure:

+------------+------------------+------+-----+---------------------+----------------+
| Field      | Type             | Null | Key | Default             | Extra          |
+------------+------------------+------+-----+---------------------+----------------+
| contact_id | int(10) unsigned | NO   | PRI | NULL                | auto_increment |
| changed    | datetime         | NO   |     | 1000-01-01 00:00:00 |                |
| del        | tinyint(1)       | NO   |     | 0                   |                |
| name       | varchar(128)     | NO   |     |                     |                |
| email      | text             | NO   |     | NULL                |                |
| firstname  | varchar(128)     | NO   |     |                     |                |
| surname    | varchar(128)     | NO   |     |                     |                |
| vcard      | longtext         | YES  |     | NULL                |                |
| words      | text             | YES  |     | NULL                |                |
| user_id    | int(10) unsigned | NO   | MUL | NULL                |                |
+------------+------------------+------+-----+---------------------+----------------+

So, I think that I found the data that I need to migrate and the question is: how? smile

Thanks again for the help.

Regards

4

Re: Emails migration from Plesk to IredMail

pmichelazzo wrote:

Some users have this structure inside the Maildir directory:
drwx------ 2 popuser popuser 77824 Mai  3 11:03 courierimapkeywords
-rw-r--r-- 1 popuser popuser    12 Mar 27 15:55 courierimapsubscribed
-rw-r--r-- 1 popuser popuser 21893 Mai  3 10:57 courierimapuiddb
-rw-r--r-- 1 popuser popuser 13523 Mar 26 12:04 courierpop3dsizelist
drwx------ 2 popuser popuser 53248 Mai  3 11:03 cur
-rw-r--r-- 1 popuser popuser  2029 Mai 21 08:28 maildirsize
drwx------ 2 popuser popuser 20480 Mai 21 08:28 new
drwx------ 2 popuser popuser  4096 Mai 21 08:28 tmp

*) You HAVE TO check IMAP folders with command 'ls -a', because all IMAP folders except default INBOX are directories start with a dot. e.g. ".Sent", ".Junk".

*) iRedMail uses Dovecot as IMAP/POP3/SIEVE server, you can find more migration tips here: http://wiki2.dovecot.org/Migration/Courier

*) Table "roundcube" is used to store addition info for your mail users, i don't think it stores mail accounts and passwords.
*) You can try to check MySQL lookup files used in Postfix, it will show you where it lookups mail accounts. All MySQL lookup files can be found with command "postconf -n | grep -i mysql".