Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing hosting provider, how to redirect during DNS propagation time

Status
Not open for further replies.

778778

Technical User
Aug 29, 2002
20
GB
Hi all,

I am having my website on one hosting provider on webhost1.
Now I am moving it to webhost2 - I did the MySQL, the code and the files part. Now I need to do the DNS part.
I know that I need to tell the domain name authority that they should use the DNSes from the webhost2 and tell the webhost2 DNSes to point to They say that it takes 24-48 hours for the propagation of the DNS record to take place. Nobody explains what happens during this propagation.
My question is: How to make sure that during this propagation period everybody accesses mysite.com from webhost2? How can I put a redirect on the webhost1 site to the webhost2, if I am using shared hosting?
Or just, how did you solve this issue before, without downtime or two servers running concurrently?

Cheers
Nick
 
Nobody explains what happens during this propagation.

not sure really why you are posting this in the php forum. but anyway ...

what happens is that some dns servers update quickly and some later. each client will address their dns server and some will be returned the old IP address and some the new. as the TTL wears out, more and more will get the new IP address.

so on the old address make sure that you are still addressing the new mysql server, then it does not matter whether which site your clients access. failing that configure an autoforwarder on your webhost's control panel ( to the new ip address). failing that change your home page on the old site to redirect to the new site using header().

you will almost certainly get a more fulsome response if you post in the right forum
 
@Jeff


is that not what i wrote?
jpadie said:
failing that change your home page on the old site to redirect to the new site using header().

also note that you should not rely on redirection using domain names as per Jeff's advice as this will fail if you are using the same domain name (of course). Use the IP address of the new server instead.
 

jpadie and jeff,

Thanks on the advice, my initial idea was to use redirect with header() but then I need to write the IP, but then the IP is shared between several sites (it's a shared hosting).

The MYSQL redirect to the new server sounds cool, I may try this

Cheers
Nick
 
if it's shared hosting then the host may not allow external access to its mysql servers. some do. bluehost.com is one.

note that you will get a real performance hit on remote mysql calls. you may be better off setting a replication schedule, but this would require you to have access to the mysql server configs of both machines. no easy way out here.
 
i should add that the way to solve this properly is as follows:

1. use a separate dns host. often you get better flexibility that way
2. set the ttl of your domain to something very low - like 15 minutes or even lower. then when you make the change you're out only for 15 minis for some clients. remember to set the ttl back to something more stable later on.

bluehost.com allow you control over the ttl even on a shared hosting package.
 
Jpadie,

Thanks for the advice. I am using currently godaddy.com and I will try to modify the TTL - I don't know if I will be able to do this.
Looks like there are some firewalls in place between the two hosts, so I looks like I will just shut down the site on host 1

Cheers
Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top