-2

I am currently hosting on Bigrock and my domain name is also from Bigrock. I am facing many issues regarding the server memory and I need to conduct an important event on my website in about 50 hours for which there are registrations going on. I have found a better plan that can solve my problems on Bluehost. The problem is that updating the name server will take a lot of time which I cannot afford to lose. Is it possible that I can add the name server from bluehost in the existing list of name servers so that all can be up simultaneously. Or is there some way out that the site's downtime is reduced as much as it can like I might be running a copy while the other one is being configured.

Sven
  • 97,248
  • 13
  • 177
  • 225
Abhinav Arya
  • 101
  • 3

2 Answers2

1

What you are asking is how to migrate servers by making DNS record changes. You can lower the TTL of the records and make sure both zone files are active (old with the old records and new with the new records) and change the DNS delegation in the domain registrar portal but it can still take as long as 48 hours for everyone to see the new DNS records. So while people see the old records they will go to the old website. If your event is in 50 hours, I would say you should be able to make this work, but the larger issue is since people are doing registrations at the same time, how are you migrating data from the old server to the new server? If you don't do that you will have some registrations on the old server and some registrations on the new server.

user5870571
  • 2,900
  • 2
  • 11
  • 33
  • Bluehost has provided me two nameservers. So here is the list of steps that I need to do: 1. Copy all the files and import the database to bluehost. 2. Bluehost has provided me two nameservers. So, I simply add these in the list of nameservers in Bigrock. So will my site at Bigrock continue to work till the copy at Bluehost comes to life ? Are the steps right ? I am sort of new to this thing please. – Abhinav Arya Aug 29 '16 at 13:35
  • If you add new DNS servers to the existing list of nameservers and the new DNS servers have different records than the old DNS servers then you will need to set lower priorities on the new servers. The problem will still be that if a user gets a record for the old server their registration during the 48 hours that global DNS updates can take, then at the end of 48 hours you will need to copy the data from the old server to the new server one more time. If you don't you will have new registrations on both the old server and the new server. – user5870571 Aug 29 '16 at 13:45
  • Okay. Although I can update the database again but still I will have to review this decision again. Currently my site is being hosted on a 2GB RAM shared linux server and I am expecting about 600-700 users logging into my website and browsing content. That's why I was thinking of shifting to Bluehost as they are providing better config at nice prices. I don't know whether existing config can handle that much traffic. – Abhinav Arya Aug 29 '16 at 13:55
  • Honestly, it may make more sense to pay a higher rate to your current hosting provider to see if they can just modify the configuration of your hosted server through the end of your event. After the event finishes then you can migrate the website to a different provider. I know it might be more expensive in the short run but it may save you a lot of things not working how you want them to in the long term. – user5870571 Aug 29 '16 at 13:58
  • You are right. But I tried a lot. The price for next better thing is really exorbitant. – Abhinav Arya Aug 29 '16 at 14:02
  • One more thing please. Whatever happens, users will not get to see that there are two copies. Although I might have to do more work. I mean user requests meanwhile will not be rejected or they will not see any errors ? – Abhinav Arya Aug 29 '16 at 14:10
  • No if you have both servers online and both DNS records in the namserver (all of the ones you are using) and the new DNS records have a lower priority then the users should be fine. You will just have to deal with merging the final databases. – user5870571 Aug 29 '16 at 14:12
1

To mitigate the issue of DNS delay described above, you can configure the old server as a reverse proxy to the new server, so that any request arriving at the old server is transparently proxied to the new server.

This reverse proxy adds a slight delay, since the request from user comes first to old server, which sends the request to new server, receives response from the new server and sends it back to the user.

So, the working order would be:

  1. Shut down site on old server.
  2. Copy files and databases to new hosting and make sure new hosting works.
  3. Configure reverse proxy at the old site.
  4. Change DNS entries so that only the new site is listed in A records.
  5. After you see that there is no traffic on the old server, you can proceed to get rid of it.

This approach makes sure that there is a single site always available.

You should be able to find several guides on how to do reverse proxying in Apache2 or nginx.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • How to 'shut down' site on the server. How to configure reverse proxy at the old site/server. How to configure the A records. Please could you help me out in these. – Abhinav Arya Aug 29 '16 at 17:45
  • Shutting down the site is the same as stopping the web server. Otherwise these are too broad topics for a Q&A site like this. There are several guides on all these topics available on the internet. You can come back with any specific questions here if you don't understand some individual concepts in the guides. – Tero Kilkanen Aug 29 '16 at 18:08
  • Okay. I got it. One specific question: when I erase the existing nameserver details from existing hosting provider and add new hosting provider's namerservers. Will it immediately shut down my site. I mean people will no longer be able to visit the site ? – Abhinav Arya Aug 29 '16 at 18:11
  • No. There are several caching layers for DNS information around the Internet, so for some time, the domain name will resolve to the server. Shutting down the server means shutting down the web server responding to the requests, or making a maintenance page which is displayed to all visitors. This makes it safe to copy all data to the new server. – Tero Kilkanen Aug 29 '16 at 18:16
  • Well that's what I want. What I can do is erase the existing records and update with new host's nameserver. By the time the DNS propagates, old site will be functioning. I will keep exporting the databases from the running site and as soon as the propagation completes, I will import the most recent database into the new site. Do you think this is possible ?? – Abhinav Arya Aug 29 '16 at 18:21
  • You cannot know when the propagation is complete, since the caches around DNS system refresh their contents when their TTL expires. Their remaining TTL depends on the time when they first resolved the domain IP the first time. With my method you can be sure that only one copy of the site is in use. – Tero Kilkanen Aug 29 '16 at 18:42
  • One last question Sir. What is your gut feeling about traffic from about 600 users during a period of 45 to 50 minutes on a shared linux server with 2GB memory. Can it sustain ? – Abhinav Arya Aug 29 '16 at 19:53
  • It is impossible to estimate anything without having a look at the code, database design, server configuration etc. All I can say that it either sustains or doesn't. You can use http://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning as a reference on capacity planning. – Tero Kilkanen Aug 29 '16 at 20:06