1 (edited by john123 2017-11-27 02:18:33)

Topic: Migrating server1->server2, both have same iredmail

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? N
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello everyone,

Basically, I am in the process of migrating from server1 to server2. I would like to completely transfer all the data (emails, accounts, mysql dbs, domain) from one server to another one. At the moment everything is working fine on server1 and I have already set up the same 0.9.7 iredmail on server2. Also, I have imported a vmail mysql backup file onto server2, I can login into iredmail control panel and I see all my account there.

Obviously, I cannot use the domain since it is serving server1 at the moment.

What would be the best and pain-free way to copy everything from server 1 and make it work on server2?

My understanding is:

- since both servers are running the same iredmail versions, I can rsync all mysql backups from /var/vmail/backup and then restore all of them on server2 with mysql -u root -p -h localhost [appropriate_user_name] < [backup.filename].sql

Since all the credentials are the same, there should be no issues importing mysql backup file on server2

- DKIM: simply rsync /var/lib/dkim server1->server2

- Mailboxes: rsync /var/vmail server1->server2

- Roundcube: rsync mysql backup from /var/mail/backup server1->server2 and restore on server2 as above

- Amavisd, iredAPD, iRedAdmin: same as roundcube

At the end I will force dovecot to recalculate mailbox quota

Once everything is in place, I will change my DNS records to match a new server.

Is everything correct or did I miss anything?


Thanks

----

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

2 (edited by schnappi 2017-11-27 01:12:42)

Re: Migrating server1->server2, both have same iredmail

When did this found that starting from scratch and importing emails via an IMAP client, copying over DKIM keys, Roundcube config file and a few other things via rsync or scp was much easier than trying to migrate to a new server. That being said the larger the server the easier a migration becomes as opposed to starting from scratch so this solution does not scale.

3

Re: Migrating server1->server2, both have same iredmail

schnappi wrote:

this solution does not scale.

I don't think I understand you. Can you please elaborate?

4 (edited by schnappi 2017-11-27 02:53:18)

Re: Migrating server1->server2, both have same iredmail

john123 wrote:

I don't think I understand you. Can you please elaborate?

A solution that scales means that the solution works just as well on a bigger scale. My solution above becomes more and more tedious the larger the user base is and therefore does not scale well. Does this make sense?

5

Re: Migrating server1->server2, both have same iredmail

schnappi wrote:

Does this make sense?

No really. So, are you trying to say that it is much better to simply copy all the emails via the IMAP client to the new server, copy DKIM, roundcube settings, Amavisd, iredAPD, iRedAdmin settings via rsync to the new server and that is it?

6 (edited by schnappi 2017-11-27 03:16:44)

Re: Migrating server1->server2, both have same iredmail

john123 wrote:

So, are you trying to say that it is much better to simply copy all the emails via the IMAP client to the new server, copy DKIM, roundcube settings, Amavisd, iredAPD, iRedAdmin settings via rsync to the new server and that is it?

If you have less than ten mail users and do not care about resetting user mailbox passwords, iRedAdmin settings, the Roundcube address book, or user Roundcube mailbox settings it is probably easier to just start a new server and rsync the DKIM keys, Roundcube config file (if you have modified it), and any other other setting files that you have heavily modified rather than to do a full blown server migration.

Does this make sense?

7

Re: Migrating server1->server2, both have same iredmail

schnappi wrote:

Does this make sense?

Oh yes, many thanks for the explanation. I do have a small scale server, so I will probably just rsync files from one server to another one. One last question - do I need to rsync mysql backup files and then import them on a new server?

8 (edited by schnappi 2017-11-28 05:30:08)

Re: Migrating server1->server2, both have same iredmail

You do not need to sync your MySQL backup files. This is assuming of course that you are okay configuring everything from scratch. This means readding users/ domains to iRedAdmin, ect. For a small server this is easier than a full migration again which is why recommended.

For the DKIM keys remember to configure the amavis config file on the new server after rsync'ing the old DKIM keys.