Moving host without breaking your email
Moving a website to a new host is straightforward. Moving the website and its email without losing a single message takes a little care.
The safe order is this. First, copy the files and database and get the site working on the new server — test it using the hosts file, before any DNS change. Second, create the email accounts on the new server and test them. Third, copy over any mail sitting on the old server. Fourth, lower the DNS TTL to five minutes a day beforehand, then switch. Fifth, leave the old server running for a week.
That last step matters. If something was missed, the old account still has it.
The failure mode to avoid is switching DNS first and copying later. That is when mail starts arriving at a server that does not have the mailbox yet, and messages bounce silently.