We have a fairly high traffic Linux web server that will be moving VPS hosts soon.

So, I need to change the domain name to point to the new IP. As far as I know, this means some requests will be going to one server, other requests to the other server for a couple of days. All session and other state is stored in the DB.

I gather we have a few options:

  1. Serve the same pages on each one, and share a database. Connect the new server to the old one's database via the network until DNS has settled in, then move the DB to the new server.
  2. Move the database to the new server. Use iptables/Apache to proxy requests from the old server to the new one.

What is the best way to do this, to make sure that the site runs smoothly?

  • I located this similar question as well, for anyone interested: serverfault.com/questions/61907/… – JAL Jun 29 '10 at 20:16
  • For anyone wondering, Google and Baidu were STILL hitting the old IP address 6 months later. – JAL Jan 25 '11 at 7:46

You should be able to lower the ttl (time-to-live) of your domain name down to 20 minutes. If you do this a couple of days before you switch servers then you will only have 20 mins where requests could possibly go to both servers.

If you can lower the ttl then I would personally put a sorry page on the old server and wait for everyone to get there requests from the new server. Depends on weather upto 20 mins of down time is acceptable I guess.

  • If your DNS server is capable, I'd set the TTL even lower than that (down to 1 or 2 minutes). This would reduce the cache delay even more. This will also allow a fast switch back to the old server if something goes awry on the new one. Once everything is stable, up the TTL again. – Justin Scott Jun 28 '10 at 13:32
  • Lower would be better I was not aware it was possible unless you host DNS yourself Ive only ever seen 20 minutes as the lowest ttl – Alistair Prestidge Jun 28 '10 at 16:28
  • Well, that sounds simple enough. I used to hear about naughty DNS servers that ignored the TTL and cached the host info for 1-2 days regardless. DO you think that's probably won't be a problem? – JAL Jun 28 '10 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.