• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Domain migration to new Server / what to do with Email during DNS update

Christian Melius

New Pleskian
Hi there,

I have upgraded to a new server and need to move all domains, users, and most important all email accounts to the new server.
Both servers run Plesk 11.0.9 on CentOS.
The migration manager works great, no problems with that.

After migrating, I change my DNS settings at an external DNS provider to the new IP. The problem is, DNS changes take time. I then get emails on the old server and on the new server until DNS information is spread.
I was searching for a way to let the old server forward to the new one, but changes for specific domains in plesks DNS system (MX record) on the old server did not work. The mails still arrived at the old server.
What can i do? Can I uncheck "Activate mail service on domain" and will all emails be rejected until DNS points to the new server? Or will that lead to bounces?
I don't want to tell all my customers to check two serversfor a couple of hours / days.

Thanks for your help,

Christian
 
Last edited:
Hello,

We are also going to migrate our Plesk servers to new data center during this summer. Here is our current plan how to do the migration.

1) Migrating domains to new server using Plesk Migration Manager (transfering couple of hundred gigabytes takes about 12 hours).
2) Adding proxy rules to iptables of old server to proxy http and mail traffic to new server.
3) Change DNS records to IP address of new server.
4) Copy new emails received by old server during the migration to new server (using rsync).
5) After day or two when DNS has been propagated, remove iptables rules or shut down the old server.

Here is our shell script for step 2 (tested only quickly):

Code:
#!/bin/bash -x

FW=/sbin/iptables

OLD_IP=192.168.1.10
NEW_IP=192.168.1.20

echo 1 > /proc/sys/net/ipv4/ip_forward

# Websites
${FW} -t nat -A POSTROUTING -d ${NEW_IP} -p tcp --dport 80 -j SNAT --to ${OLD_IP}
${FW} -t nat -A PREROUTING -d ${OLD_IP} -p tcp --dport 80 -j DNAT --to ${NEW_IP}
${FW} -t nat -A POSTROUTING -d ${NEW_IP} -p tcp --dport 443 -j SNAT --to ${OLD_IP}
${FW} -t nat -A PREROUTING -d ${OLD_IP} -p tcp --dport 443 -j DNAT --to ${NEW_IP}


# Emails
${FW} -t nat -A POSTROUTING -d ${NEW_IP} -p tcp --dport 25 -j SNAT --to ${OLD_IP}
${FW} -t nat -A PREROUTING -d ${OLD_IP} -p tcp --dport 25 -j DNAT --to ${NEW_IP}
${FW} -t nat -A POSTROUTING -d ${NEW_IP} -p tcp --dport 143 -j SNAT --to ${OLD_IP}
${FW} -t nat -A PREROUTING -d ${OLD_IP} -p tcp --dport 143 -j DNAT --to ${NEW_IP}
${FW} -t nat -A POSTROUTING -d ${NEW_IP} -p tcp --dport 110 -j SNAT --to ${OLD_IP}
${FW} -t nat -A PREROUTING -d ${OLD_IP} -p tcp --dport 110 -j DNAT --to ${NEW_IP}
 
Last edited:
Back
Top