New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Email server migration best practice?
I have a postfix+dovecot+mysql email server and would like to transfer it to a different VPS. What is the best way of doing this?
My plan is to simply transfer the installation and change the DNS records, but I am concerned about emails that are sent to the old server, for example if the sender caches DNS. Can I just use rsync on the email folder, or does dovecot need some internal magic to recognize new emails?
How would/do you do it?
Comments
if you dont have large amount of boxes just use imapsync https://imapsync.lamiral.info/
most of webhosters are using it in case of customer migration.
Lower the TTL of hosted email domains to 600 24 hours before migration.
Then update DNS records to point to the new server.
Then shutdown postfix on the old server.
Don't forget to migrate the mails in between 1 and 2.
Once the MX record is pointed to the new server, the emails automatically route to the new server. The best advice would be to transfer the server at weekends or when there is a less traffic.
Just run imapsync at intervals during the "migration"
That's wrong. Any DNS resolver could be caching the old record. It is absolutely imperative that you shut down the old mail server before setting the new DNS record - or handle it some other way, e.g.:
Same goes for any migration where you're relying on DNS. Don't blindly trust resolvers you don't control to respect your records or your TTL.
If you have maildir storage
keep old server running for 2 days