Hello, I had a client who changed domain (domain1.com to domain2.com) They wanted to copy entire email/folders account from (old) [email protected] to (new) [email protected] I did the following (I have done this in the past and it worked) 1) rsync -avzh [email protected]:/var/vmail/domain1.com/maria /var/vmail/domain2.com 2) chown -R vmail:vmail /var/vmail/domain2 I can see folders & subfolders got copied via rsync (Maildir sieve) when I login to webmail/roundcube under (new) [email protected] I don't see any messages. I appreciate any assistance.
That should work if the directory structure on the target server is same as in old, that is extra directory level was not created by mistake or something. Maybe running doveadm command with suitable arguments on the target server would fix it? On the other hand, did you check the mailbox worked before you copied the old mails there? If not, there are other ways to transfer e-mailboxes from server to server. Try Internet Search Engines with Code: site:howtoforge.com migrate e-mail
I assume the domain2.com domain already exists as another maildomain, so it's just the one mailbox you're trying to change? as far as i'm aware, if you go into the mailbox settings in ispconfig and just change the domain part then it will move/change all the files and folders for you. you'll need to manually change the domain part of the login field if you require the login to match the email address. I believe that's all you need to do, but you may want to create a couple of test domains and a mailbox to test it with first before doing anything to a live domain/mailbox. i know the files/folders will be changed for you if you change the maildomain in ispconfig, but I've can't remember ever trying it with just a mailbox.
Solved! Thank You so much @Taleman & @nhybgtvfr. I just went into email account of [email protected] and from dropdown changed from domain1.com to domain2.com and it worked. I can now see all the emails in webmail/roundcube.
For future reference. To copy all mails from one account to another, especially if they are in different servers, you could try: Imapsync online Imapsync installable Imapcopy
Additionally for future reference Only for dovecot imap servers Moving mails from one dovecot mailbox/maildir to another (or different folder inside a mailbox) should be done with doveadm move: https://wiki.dovecot.org/Tools/Doveadm/Move Moving to from one server to dovecot should be done with dsync: https://wiki2.dovecot.org/Migration/Dsync This is the recommended way and preserves metadata/uids/etc. Otherwise it could happen that all mails are resynced, metadata is missing, migration takes much(!) longer, etc..