merge 2 servers into new 1?

TestUser

Verified User
Joined
Aug 26, 2011
Messages
222
Hi!
current situation is like this:
- SERVER 1 => www, ftp
- SERVER 2 => DNS, EMAIL

Now i want to migrate everithing to new server SERVER 3
ok... no problems with www and ftp..but how can i then merge emails?

Let's say i transfare users from SERVER 1 to server 3
ok...now i have on SERVER 3 all the users and WWW
but how can i now transfer emails from SERVER 2 to SERVER3,
becouse users already exists with www

i have googeled but didnt find the answer...
Any idea?
 
Yes, it's easy to "merge" mails. Just transfer /home/*/imap, /home/*/Maildir and /etc/virtual directories from the email server, and make sure you have correct permissions set, as well as correct user ID in /etc/virtual/domain.com/passwd files (usually 3-4 numbers before ':12:' part. Don't forget to add domains to /etc/virtual/domains. Good luck! :)
 
If user is using pop3, he doesn't have his mails stored on the server (if he leaves copies on the server (not a default setting), they're still in imap directories) :)
 
I hope I'm not too late coming to the party... I have some valuable experience as I've done something similar within the last two months...

It doesn't matter if you're using IMAP or POP3, if you're using Dovecot all emails are in separate files.

What I've done is used the Admin level backup/restore option to move only emails. This maintains any differences in any per-domain flat email files, which I believe Martynas (smtalk) is ignoring.

Two problems with my method:

1. If there's a chance you're merging email stores (and there is, as both servers could have emails on them, if they were sent by the local server and the /etc/virtual/domains file could have errors), you should delete all the index files in the mailstore so Dovecot will rebuild them the next time the user logs in. (Don't worry; it's so fast the user won't notice, even for thousands of emails). I delete all the files beginning with dovecot or Dovecot in every directory of each mailstore (you can do it with one command line if you're careful :)).

2. DirectAdmin's Admin level backup/restore always backs up and restores the DNS zone file, even if you just tell it to backup email. So if the zone files could be different, I resolve this issue by chattr-ing all the zone files immutable before doing the restore (don't forget to chattr them back as mutable or neither your nor your uses will be able to change DNS).

Don't be confused by the DirectAdmin naming convention, which uses a folder named imap; it's used for all email, both IMAP and POP3.

Jeff
 
Back
Top