Move email accounts to new server

gonzalomassa

Verified User
Joined
Feb 24, 2015
Messages
6
Hi

I know this has been asked before, but the solutions I've found to move emails implies transferring a backup from DirectAdmin and I can't do that because the server has 10G of emails and no such free space to create a backup (I've tried but it gives me a full disk error).

Both servers are VPS on the same hosting provider so I think there will be no problem on transferring 10G of data between them using scp, the problem is I'm not an expert on how e-mail are stored and how can I transfer it manually, that's why I'll ask the following questions.

- Can I transfer all e-mail accounts just by copiyng files and folders?
- Which ones should I copy?
- The new server doesn't have any account configured yet, do I have to create them first, or just by copying the files also make the accounts show up on the server?
- Should I reconfigure any permissions or ownership on the copied files?
- What's the best method to switch from one server to another without losing new messages? I unterstand there will be a window of time where the dns will propagate to the new server, so any new messages will arrive to one server then to the other.

I think that's all the questions I have for now, some info on the servers:

Current server:
CentOS 5.11
DirectAdmin 1.55.0
custombuild 1.2.43
Exim 4.76
dovecot 2.2.15

New server:
centos-7.3-x86_64
DirectAdmin 1.55.0
custombuild 2.0.0 (rev: 2005)
Exim 4.92
dovecot 2.3.4.1

Thank you and pardon my english :)
 
Hello,

Here is a simple plan I would follow:

0. Lower TTL for domains: https://help.directadmin.com/item.php?id=87

1. Create backups in Directadmin at admin level https://help.directadmin.com/item.php?id=269 containing only (an option "Selected Data" should be used):

[x] E-Mail Accounts
[_] E-Mail Data
[x] E-Mail Settings
[x] Vacation Messages
[x] Autoresponders
[x] Mailing Lists
[x] Forwarders

Make sure "E-Mail Data" is unchecked as well as other options.
You can make the directadmin to store backups locally or on a remote FTP server.
The selected options does not require much disk space.

2. Then import backups to your new server

3. As soon as all users are imported fine I would use rsync to sync emails located under /home/username/imap/ and /home/username/Maildir/ from old server to the new one: https://help.directadmin.com/item.php?id=500

4. Update DNS settings and other options whenever it's required for SMTP, POP, IMAP to work fine. Depending on whether you want to use both servers at the same time, or you are going to retire the old server: https://help.directadmin.com/item.php?id=8

5. Final syncing after DNS zones changes propagated.

Something like this....
 
5. Final syncing after DNS zones changes propagated.

Thank you again for your help, I'll try this week.

So if new messages arrives to the old server I can rsync again and bring them to the new server, right?
 
Just migrated clients from one server to another and used the above for migrating emails as they had large mailboxes.

One issue that I wasn't aware of with the above is that if Email Data is unchecked roundcube settings and contacts won't be migrated as per this feature article:

https://www.directadmin.com/features.php?id=1062

The roundcube xml file falls under the "E-Mail Data" checkbox. It's contents include essentially everything you can see in Roundcube, contacts, contact groups, identities, and other miscellaneous settings.

I'm now looking into how to migrate roundcube settings from the old server to the new server where the clients are already using the new server.
 
you can try this:

 
Back
Top