If I get this right the old server has a single IP address and the new one has only one, too.
So what you could do is to set up the new server and on it just route all relevant http/https/ftp/whatever traffic to the old IP and then update the DNS records to show the new IP.
If you only have one IP you can use a simple find/replace to change all IPs in the DNS (don't forget to update the serial number) at once and wait for your current TTL to run out. Once the TTL has run out you can just remove the routes on the new server and adjust your other settings, so that it serves the sites directly instead of redirecting.
Before removing the routes the websites should have been moved to the new location obviously. This has the advantage that you don't have to rely on other DNS servers to update their records in time you can just "wait it out". To shorten that period you can reduce the TTL but be aware that some DNS caches out there ignore the TTL settings, that's why I don't rely on TTLs any more.
Edit/further explanation:
To make it somewhat easier to understand:
You can also just install your new server right now, configure everything and move all your sites to the new IP and THEN route all traffic from the old server to the new server.
E.g. your old server has the IP 192.0.2.1
your new server has the IP 198.51.100.2
Your DNS points to 192.0.2.1
for all sites(?) and the webserver decides which content to serve by the name of the domain requested, e.g. example.com
-> /var/www/sites/example.com
and www.example.com
-> /var/www/sites/example.com
.
So you just turn this:
example.com -> 192.0.2.1
Into this (as soon as you moved the sites to 198.51.100.2):
example.com -> 192.0.2.1 -> 198.51.100.2
And then change the DNS records to point to 198.51.100.2:
example.com -> 198.51.100.2
The problem with DNS is that the update is never instant, so for some of your clients example.com will still point to 198.51.100.2 for a variable amount of time (either the TTL you set or, if they ignore it, who knows how long).
So my point is: Instead of relying on DNS, redirect the traffic on the IP layer so you reduce downtime. I hope this makes it a bit more clear.
On Ubuntu you can do it with forwarding and NAT (e.g. routing http and https for your old destination 198.51.100.2 to your new destination 198.51.100.2; these settings done on your old server):
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p tcp --dport 80 -m state --state NEW -j ACCEPT
iptables -A FORWARD -p tcp --dport 443 -m state --state NEW -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 198.51.100.2:80
iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 198.51.100.2:443
iptables -t nat -A POSTROUTING -j MASQUERADE
A
records, the DNS will always get back both, even if one IP does not work anymore. Someone or something will need to explicitely remove the defunct IP from the zone.www
record but not for the apex. Also, will it be better to modify the CNAME than modifying the A record? I'm not sure.