Copying Unread Emails To New Server

I was hosting emails for one of my clients with MIAB. Two days back I changed servers and set up a new box for them, and everything is working fine. However I forgot to move existing email from the old server. Is there a way to move unread emails from the previous box to the new server now?

I had taken a backup of the /home/user-data/mail/mailboxes/ folder from previous box, and the domain name and email accounts remain the same (passwords for the email accounts might be changed) in both the boxes.

I assume, you didn’t copy any mail at all, so the users started their account with an empty box.

In that case, it should be quite simple.

If the folders on the source and destination folder are the same, you can easily do this with rsync; er is also a tool available, imapcopy, which can be used to manually copy the content of an Imap mailbox.

rsync can used over ssh; don’t forget to setup a private/public key combo for this copy action.

Thanks for the reply.

The user started with empty mailbox, but might have received emails after that. Does it matter?
I guess what rsync does is copy everything from source to destination, so will a manual copy paste of these mailbox folders work, like say over an FTP?

Not if you format the rsync correctly … iow … there is an option to delete items on the target server that are not on the sending server, be sure that is not chosen.

In theory, I suppose so … but that is an awful lot of work compared to rsync.

If you are talking 1 or 2 mailboxes, then I suppose it doesn’t matter. But more than that … rsync all the way!

If your hesitation is that you are not familiar with rsync … there are many guides online and as long as you get the syntax right, it is relatively easy.

But … there is a big assumption in the previous users response … is the old MiaB install still accessible, or has that VPS been destroyed?

I had only 3 mailboxes to be copied. And copy/paste over FTP worked like a charm.

Thank you all.