1 (edited by lug 2016-12-08 18:54:03)

Topic: Migrate very old Version

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.7.3
- Linux/BSD distribution name and version: Debain 6 -> Ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes, lifetime license
- Related log if you're reporting an issue:
====

Hi,
I have to migrate a five year old iRedMail Server, and i'm running into problems.

I backed up the old database

mysqldump --user=*** --password=*** --all-databases > dump.sql

and backed up the mails from /var/vmail.
(I just copied the folder, is that enough or do i have to use some tool?)

I installed the newest version of iRedMail & iRedAdminPro onto the new ubuntu machine.

Now I'm getting into trouble with migrating.

When I want to import the old mysql dump it shows some errors and the webpanels dont work anymore.

the old mysql database includes these databases:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| amavisd            |
| iredadmin          |
| mysql              |
| phpmyadmin         |
| postfixpolicyd     |
| roundcubemail      |
+--------------------+

I am also wondering, the iredadmin panel shows i'm using ldap, are all the mails in /var/vmail stored as ldap and the user accounts as mysql, or how to i have to understand that?
I've read this: http://www.iredmail.org/docs/migrate.to … erver.html
but it didn't really help me..

So it would be nice if somebody here could help me smile

----

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

2

Re: Migrate very old Version

lug wrote:

the iredadmin panel shows i'm using ldap, are all the mails in /var/vmail stored as ldap and the user accounts as mysql, or how to i have to understand that?

"ldap" backend means mail accounts are stored in LDAP. mailboxes are still stored on file system (/var/vmail by default).

Please follow the backup/restore procedure in the link:
http://www.iredmail.org/docs/migrate.to … erver.html

3

Re: Migrate very old Version

How do I find the information which format my mailboxes are?

I tried to look up my mail path on both machines, to compare if they match, but it just gives me errors.

ldapsearch -x -D 'mail=***@***,o=domainAdmins,dc=***,dc=***' -b 'o=domains,dc=***,dc=***' -W "(mail=***@***)" homeDirectory

On the old debian machine i get:

# extended LDIF
#
# LDAPv3
# base <o=domains,dc=***,dc=***> with scope subtree
# filter: (mail=***@***)
# requesting: homeDirectory
#

# search result
search: 2
result: 0 Success

on the new ubuntu machine:

# extended LDIF
#
# LDAPv3
# base <o=domains,dc=***,dc=***> with scope subtree
# filter: (mail=***@***)
# requesting: homeDirectory
#

# search result
search: 2
result: 32 No such object

I've got the DN from the iRedAdmin webpanel, as i exported the admin account to ldif

4

Re: Migrate very old Version

lug wrote:

How do I find the information which format my mailboxes are?

iRedMail uses Maildir format, no mbox or others.

lug wrote:

I tried to look up my mail path on both machines, to compare if they match, but it just gives me errors.

Use 'cn=manager,dc=xx,dc=xx' as bind dn, it has full access to LDAP data.

5 (edited by lug 2016-12-09 15:50:46)

Re: Migrate very old Version

Is there an easy way to get the password for manager via console?

I only have SSH/FTP access to the server, yet.

Otherwise I'll have to get it next week

6

Re: Migrate very old Version

User passwords ( encrypted) are stored in ldap attribute name "user password" , you can get it with command "ldapsearch".

7 (edited by lug 2016-12-12 17:58:34)

Re: Migrate very old Version

this doesn't work for me, gives me more errors..

s̶o̶ ̶i̶ ̶t̶r̶i̶e̶d̶ ̶t̶o̶ ̶l̶o̶o̶k̶ ̶i̶n̶t̶o̶ ̶t̶h̶e̶ ̶l̶d̶a̶p̶ ̶d̶a̶t̶a̶b̶a̶s̶e̶,̶ ̶w̶i̶t̶h̶ ̶"̶s̶l̶a̶p̶c̶a̶t̶"̶

a̶n̶d̶ ̶t̶h̶e̶r̶e̶ ̶a̶r̶e̶ ̶j̶u̶s̶t̶ ̶2̶ ̶a̶c̶c̶o̶u̶n̶t̶s̶?̶

d̶c̶=̶m̶y̶d̶o̶m̶a̶i̶n̶,̶d̶c̶=̶c̶o̶m̶

c̶n̶=̶a̶d̶m̶i̶n̶,̶d̶c̶=̶m̶y̶d̶o̶m̶a̶i̶n̶,̶d̶c̶=̶c̶o̶m̶

f̶o̶r̶ ̶t̶h̶e̶ ̶a̶d̶m̶i̶n̶ ̶e̶n̶t̶r̶y̶ ̶t̶h̶e̶r̶e̶ ̶i̶s̶ ̶a̶ ̶u̶s̶e̶r̶P̶a̶s̶s̶w̶o̶r̶d̶

r̶i̶g̶h̶t̶ ̶n̶o̶w̶ ̶i̶'̶m̶ ̶j̶u̶s̶t̶ ̶c̶o̶n̶f̶u̶s̶e̶d̶ ̶w̶h̶a̶t̶ ̶i̶s̶ ̶g̶o̶i̶n̶g̶ ̶o̶n̶ ̶t̶h̶e̶r̶e̶,̶ ̶a̶c̶c̶o̶u̶n̶t̶s̶ ̶s̶h̶a̶l̶l̶ ̶b̶e̶ ̶s̶t̶o̶r̶e̶d̶ ̶i̶n̶ ̶l̶d̶a̶p̶,̶ ̶b̶u̶t̶ ̶t̶h̶e̶r̶e̶ ̶a̶r̶e̶ ̶n̶o̶n̶e̶?̶

had to set "-f /etc/ldap/slapd.conf"

8

Re: Migrate very old Version

I'm sorry that the ldap attribute name is incorrect in my previous reply, it's "userPassword", not "user password" (typed with a phone, it auto "corrects" the typing).

You should be able to dump whole LDAP tree with command "slapcat -f /etc/ldap/slapd.conf".

9 (edited by lug 2016-12-12 20:42:40)

Re: Migrate very old Version

Yep I did that and migrated it to the new server (successful).

I can now login to the iRedAdmin Panel with the migrated data.

So I have my postmaster account (postmaster@mydomain.com) and its password,
the login on the iredadmin panel works just fine.

So I copied the old maildir

/var/vmail/vmail1/mydomain.com/p/o/s/postmaster-2012.01.12.10.07.45/Maildir/*

to the new one

/var/vmail/vmail1/mydomain.com/p/o/s/postmaster-2016.12.08.08.37.10/Maildir/*

to test if the mails migrated succesful. I also copied everything of the sieve folder.

But now I cannot login to the postmaster account in thunderbird anymore, but the login on the iredadmin panel works..?
Is there any option which prohibits the postmaster from logging into its mail account?

10

Re: Migrate very old Version

Check the Dovecot log file please.

11

Re: Migrate very old Version

found the issue, postmaster had no mail account on the old iredmail server, just an account for the iredadmin panel.

dovecot log didn't show the error,
i had to edit the /etc/dovecot/dovecot.conf first and uncomment

auth_debug = yes
auth_debug_passwords = yes

now everything works just fine, thx for the help smile