Mobile app version of vmapp.org
Login or Join
Nimeshi995

: Switching website DNS with minimal downtime I need to change my domain's DNS, but here in Thailand the ISPs don't follow any standards for renewing their cache of records, so it can take the

@Nimeshi995

Posted in: #Dns #Domains

I need to change my domain's DNS, but here in Thailand the ISPs don't follow any standards for renewing their cache of records, so it can take the full two days.

I have a new website with about 1,000 members currently who are sending messages and uploading photos. I don't want both sites on the old and new server running at the same time because then I'd have to manually merge the database and transfer uploaded photos. It would be a huge pain.

Both servers also a unique URL from my host, e.g. website12345.hostingcompany.com (old host) and website67890.hostingcompany.com (new host).

I don't have much experience with this, but I think what I can do is on mysite.com, use .htaccess to do a masked redirect to the new server's URL (website67890.hostingcompany.com). Is it possible to do this and keep all URLs being masked? For example, mysite.com/profile/username will actually be loading website12345.hostingcompany.com/profile/username. From Google searches it sounds like this is possible, but I don't understand why this is possible due to security issues, since what's keeping people from masking their site to URLs like facebook.com?

I could really use some advice here! Thanks!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Nimeshi995

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

DNS takes time to propagate. You can lower the TTL, but even then you will have some users that try to get to the old server for a short amount of time. If the TTL isn't being honored at a low value, I don't know of anything you can do about that.

The typical way of not having to merge databases between two sites is to create "read only mode" for the old site. In this mode, users will be able to view the site, but won't be able to upload or change data. StackExchange has such a mode and I've seen them use recently when the data center in NYC had problems and they had to fail over to Oregon. Their website had a message that said the site was in read only mode. You couldn't log in, post new questions, or answer questions.

Implementing read only mode could be as simple as changing the permissions for the user that your site uses to access its database. For MySql that might be:

REVOKE INSERT ON *.* FROM 'mysite'@'localhost';
REVOKE UPDATE ON *.* FROM 'mysite'@'localhost';


Then users would see error pages when they try to update content. A more user friendly approach might be to show an error message and configure the web application not to allow data changes during this period.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme