Mail migration: how to easily move from one server and go to another

The topic indicated in the title may look irrelevant to respected Khabrovites, but sometimes it is simply necessary to raise it. The fact is that I have been working for many years as an administrator at a scientific institute of a humanitarian orientation, where employees have such qualifications in the field of modern information technologies that the notorious bookkeeping from jokes about an IT specialist against this background seems like a collection of philosophers dedicated to all the secrets of being. Respected scientists manage to enter the names of mail servers in Russian letters, instead of the “@” sign, write “dog” in brackets (and then say that it was written in the mailing address sent to them), try to send mail to WhatsApp using The Bat! and do a bunch of other weird stuff, often in the same message. It is useless to teach them, it is impossible to fight them; it remains to accept their fate and automate as much as possible all the operations related to correcting their mistakes.

One of the most sinister and dangerous operations in my experience was the migration of Web mail from server to server. The fact is that the institute's employees have as many as three official mails: one includes an internal Exchange server, the other works on Mail.ru, and the third on Gmail. No, I'm not the idiot, and not even them. This is an order of the directorate, connected with some kind of departmental games. Something must remain inside the institute on the “corporate” server, something related to applications and grants must certainly go through Russian mail, and my respected colleagues have Gmail connected to such, of course, necessary things as documents and spreadsheets Google, backup to disk, etc. The only trouble is that seven nannies, as you know, have a child without an eye - that is, in this case, between three mail servers, my colleagues in the most unambiguous way manage to lose the most important letters!

There is another problem that often causes the need for mail migration. Modern mail services often allow automatic relaying of messages from one server to another, that is, mail collection. And a user who is used to the fact that his messages on a server, say, Mail.ru, are automatically copied to Yandex mail, sometimes forgets in the end that in this way he does not get access to all messages, but only to those that were received after mail collection settings. Therefore, he may have a natural desire to perform a complete migration of mail from the old server to a new, more frequently used one, and to whom will he go with this desire? That's right: to the nearest system administrator!

I think that a similar situation arises for anyone who is somehow forced to have several mail accounts, much less administer them, or simply wants to move from server to server without losing important information. Of course, IT bison can easily solve this problem in two clicks, but if you are inexperienced in such matters, then email migration can turn into a difficult task for you. Therefore, I decided to briefly share my experience on how to easily export mail messages to some storage and then import mail to another server. Perhaps this operation will help someone get rid of minor troubles or simply make life easier!

Exporting emails: some theory, some practice

In principle, mail servers work with client programs using one of two protocols: POP3 or IMAP. If these names suddenly don’t tell you anything (does it still happen?), I’ll try to explain in simple words: the POP3 protocol downloads letters from the server to your computer, and the IMAP protocol processes them directly on the server. Older email clients worked (and continue to work) by default with the POP3 protocol, uploading email messages to a folder specially allocated for the client (usually located somewhere in the user's directory, among the application data folders hidden by default). The IMAP protocol is more modern, and it can also be used to import emails to local or network storage. So the question is basically not how to download the right emails, but how to forward them to the right server to perform the mail migration. The easiest option is to use the IMAP protocol, copy all letters using it to some storage in EML format, and then upload them to another folder on another account, taking advantage of the fact that the format of the letter files is generally exactly the same.

How to do it?

The simple method that I use with the least cost is to migrate mail messages using some data copy program that supports the IMAP protocol. This is done in two steps.

  • Import mail from a folder on the server to some storage in EML format.
  • Export mail messages to some other folder on another server via IMAP.

At the same time, the mail migration program behaves like a regular IMAP client from the point of view of both servers. (By the way, most mail servers will require you to allow the specified program to be used as a mail client, so be sure to log into your mail account and allow the server to use this utility in the list of available IMAP clients before performing a mail migration with any utility). Such programs usually require a minimum of manual work to pre-configure email migration. Usually, you can even set up a schedule for regular automatic mail migration from server to server, if you need it for some reason. Personally, I use the program to export mail letters Handy Backup, fortunately, we have it on almost all machines and requires a minimum of settings, moreover, they are centrally carried out from the administrator's machine - there is no need to go anywhere with your feet. But in the grand scheme of things, the software you use doesn't matter, as long as it can export and import mail directly to Web servers, and maintain the same email format on both servers.

And Microsoft, as usual...

A separate headache is the migration of Exchange or Outlook e-mail (I do not mean the Outlook.com mail server, but the client), because Microsoft, as usual, is following a non-standard path. Well, if in this situation you have at hand a specialized software for exporting emails from Outlook or Exchange servers, then the task is simplified to reading the instructions for migrating mails under the control of the corresponding program. It's good that there are quite a lot of such programs, as well as specialized plug-ins for the corresponding software, focused on Microsoft products.

POP3 email migration

Some people like perversions, but in general this is not the case. Therefore, it is not necessary to transfer mail from server to server using the POP3 protocol, it is old and ugly. Switch to IMAP on both servers (how to do this, almost every provider has detailed instructions), and then do everything as described above (or at least use the migration tool built into the mail service - sometimes there are such tools, although their convenience and the logic of operation usually leaves much to be desired). You can also try the old-fashioned manual method: using the client program, move letters from folder to folder, or simply select them and send them to a new server. Once upon a time, when we were little, we all did just that, and it didn’t seem indecent to us, so in a hopeless situation, you can try again to do such manual work ...

In general, the migration of e-mail from server to server by sequentially importing mail into the repository, and then exporting mail messages to a new server via the IMAP protocol satisfies all the main criteria for the convenience of working with programs. These criteria are clear logic, security, automation, and the presence of a large number of ready-made tools available that can do the job for you. So, I hope this note of mine will be useful to someone and will make life easier in those cases when the accounting department or the planning department suddenly urgently demand to transfer them from Yandex to Mail.ru, from Google to Yahoo! or somewhere else, where the chief, suddenly preoccupied with the deployment of mail, orders. Don't let yourself get tired, colleagues!

Source: habr.com

Add a comment