Forum Moderators: buckworks & webwork

Message Too Old, No Replies

Web Host change with dynamic SQL data

         

slobizman

10:01 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



(I've searched the topics and didn't find anything that answers my specific question.)

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?

jamesa

10:35 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First of all take the dns propagation out of the picture. Drop the TTL (time to live) down to a few seconds and then wait a couple days. This way when you do the switch it will happen in an instant.

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

slobizman

10:59 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



Could someone explain the TTL thing more--I really don't what this is? Still consfused...

The MySQL syncing thing sounds interesting. I guess I'll see if I can find some info on that.

jamesa

1:26 am on Sep 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TTL is a setting in DNS. Whomever has control of your DNS should be able to change it.

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.

moltar

1:54 am on Sep 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also write into a new database from a remote server, you just need to allow that. It'd be slower, but you won't loose the posts. Just warn the users about it.

slobizman

2:13 pm on Sep 30, 2003 (gmt 0)

10+ Year Member



So,

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?

jamesa

5:17 pm on Sep 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That sounds about right.