1

Topic: how to migrate ldap/mysql users - the same linux and iRM version

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 096
- Linux/BSD distribution name and version: centos7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):Apache
- Manage mail accounts with iRedAdmin-Pro? n
- Related log if you're reporting an issue:
====
When I install something new I make backup of .vdi file (oracle virtual machine). So I did before iReadmail installing on clean centos. Then I add 100 users in LDAP manually... Next day I noticed my centos does'nt reboot, but hangs when rebooting.
Because of problem with centos  I used  backuped .vdi  with clean linux centos (reboot works), next I installed iRedMail. Now I need to restore users from ldap. Is there written procedure how to do it? I still have the whole installation with users in ldap (and rebooting problem) as .vdi, ready to use. When I just restored ldap backup (yes, I changed pass in ldif), I still had some problems ... I couldn't log in to roundcube for example.

----

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

2

Re: how to migrate ldap/mysql users - the same linux and iRM version

We have a tutorial for you:
http://www.iredmail.org/docs/backup.restore.html

If you cannot boot server to get a full ldap backup, maybe copy the whole OpenLDAP database directory (/var/lib/ldap) to new server should work.

Needless to say: BACKUP FIRST.

3

Re: how to migrate ldap/mysql users - the same linux and iRM version

I restored LDAP. When I try to log to iredamin as postmaster I have "Error: Password of cn=vmailadmin is incorrect." Should I do more actions?

4

Re: how to migrate ldap/mysql users - the same linux and iRM version

m.krzaczek wrote:

When I try to log to iredamin as postmaster I have "Error: Password of cn=vmailadmin is incorrect." Should I do more actions?

Isn't this issue already mentioned in the tutorial i gave in previous reply? smile

5

Re: how to migrate ldap/mysql users - the same linux and iRM version

no apparently sad After restoring ldap I can connect and browse the tree with gui tool ldapamin.exe. But I can not log in as normal user to mail, an as a postmaster to iread admin, so I thing all passwd stored in LDAP are wrong, correct? SLAPD status is running. The second possibility is that I edited passwd for vmail and mailadmin in bad way in ldif file before  restoring - but i did many tries in different way. Addtionaly I have "export" from "old server" made with ldapamin.exe and I was import it succesfully (wihout errors with ldapadmin.exe) - in two ways: changing pass for  vmail and mailadmin and without changing ... passwords are from tips of course. So i haven't Idea. Any help? If not I add users manually, it will takes less time ..

6

Re: how to migrate ldap/mysql users - the same linux and iRM version

One more try ...  I hashed and copied pass to ldif ... and works ... uff
so mistake with coping do ldif

7 (edited by m.krzaczek 2017-02-28 20:36:56)

Re: how to migrate ldap/mysql users - the same linux and iRM version

When I run backup I have such a message:
Removing plain LDIF file: /var/vmail/backup/ldap/2017/02/2017-02-28-12-08-53.ldif...  [DONE]
ERROR 1045 (28000): Access denied for user 'iredadmin'@'localhost' (using password: YES)


ldif is created, is it a problem?

8

Re: how to migrate ldap/mysql users - the same linux and iRM version

m.krzaczek wrote:

ERROR 1045 (28000): Access denied for user 'iredadmin'@'localhost' (using password: YES)

This error will not occur if you have file /root/.my.cnf with a running mysql server. But it's safe to ignore - anytime.