I’m moving several web sites to a new host for my client.
Because domain name changes may take as much as 48 hours to propagate across the Internet, there will be a long interval when some users see the old site and some see the new one.That’s a problem for one site, because it processes transactions which update a database, and uses sessions to maintain state information. That causes technical difficulties which I need to address.
This is a problem which must affect thousands of web sites each year, and it seems to me that web developers and site administrators must have some useful experience in solving it. I’m looking for suggestions that draw on that experience, whether in the form of tribal wisdom or (preferably) codified as “best practices.”
Here is my thinking so far about the technical problems themselves:
Users who get the old site will update the old site’s database; users who get the new site will update the new site’s database. At the end of the transition we’ll have a different set of new transactions in each database, and no way to merge them.
I’ve been advised to deal with this by taking the site off-line briefly for the transition. While it is offline I’ll move the database from the old site to the new site and point the old site’s scripts to the new site’s database. When the site comes back on-line it will run in parallel on both hosts for a couple of days, but both hosts will use the same database. That appears to be a satisfactory solution.
The session problem is thornier. If a user is in the middle of a session when the domain name server they depend on is updated, they’ll be shifted from the old server, where the session is defined, to the new server, which has never heard of it. Result: error messages, lost work, general unpleasantness.
I thought about writing a session handler that stores the session data in the database, but that’s not a solution because the new server can’t get the data without the session ID, and in the scenario I just described, it won’t have the ID.