I have a web site with a very active MySQL database forum--1500 posts a day. I find that I many need to change web hosts now. How can this be done smoothly? I can't just make a duplicate of my web site from the old host to the new host and have some people hitting one host and others hitting the other host as the DNS nameserver changes propogates around the interent.
I know this has to be is a common issue, so how do people do this?
Regarding the database, have your export/import routines ready to go, bring down the sql server, export the data, import it into the new server, switch the DNS and a few seconds later you're live.
If you don't want to bring down the database at all then I'd look into replication - I know MySQL has this where you can run multiple databases and they automatically stay in sync.
HTH
The long of it, for those who don't understand DNS... When ever someone requests your webpage one of the things that happens is that a name server close to them (most likely their ISP's name server) checks with your name server to find out the IP address of the domain they are requesting. Once it gets the IP for the requested domain it saves that info for future use. That way the next time a user requests a page from the your domain, the name server doesn't need to go out and check the IP address again since it's now cached locally. This saves overhead. But after a period of time the name server will stop using it's cached data and will check your name server again to make sure it's still up to date. The length of time that it holds the data for is set via the TTL.
So if you want other name servers to update their caches frequently (like when there is an impending server move) set your TTL low. If your IP is not changing anytime soon and you want to reduce the load on your own name servers, set the TTL higher.
1) I set up my new web host account somewhere, but do not point a domain at it yet (or maybe they can since teh nameservers don't reference them yet).
2) Set my TTL as you suggested.
3) Move my web site over there and test (hopefully I can test everything including my MySQL-based forum without the domain name on the new host yet).
4) Stop any additions to my forum or anything else that changes the data. Put a note up that I will be down for a bit.
5) Refresh the new site with latest data and pages from my current site.
6) Change my DNS nameserver info to the new web host's info. and, if I did not do it yet, tell web host to point domain to the web site.
7) At some point, reset teh TTL back to something higher?
Should be in business now, right?