transparent migration strategies

On my last web site migration to Linode, I did the usual thing– set up a copy of the site, change the DNS records, and wait for those records to propagate. That worked fine, although as I quickly learned, the old address was cached by ISPs, local caches, etc. The end result was that while the majority of people did transition to the new site, others randomly got the old site. That caused some confusion, but because the majority of people on that site were technically aware, it wasn't a big deal.

The next site I'm moving features a user population who are generally clueless regarding anything technical. So for this migration, what I would like to do is find some way to force users who hit the old site (because DNS hasn't propagated) to the new site. The old site would be shut down, and anyone who ended there would be redirected until such time as their DNS was properly updated.

Any simple solutions others have come up for this situation?

7 Replies

Well, at the very least I would replace the old site with a static "Migration in progress" page, with a brief explanation of what's going on for the less tech-savvy users.

~JW

@JshWright:

a static "Migration in progress" page
+1.

Sometimes it's better to make some of your users wait a day or two than to allow them to keep posting stuff to the old site. They'd be pissed up even more if the stuff they posted mysteriously disappeared!

Alternatively, if all your dynamic data is in MySQL, you can point both sites to the same MySQL instance to keep them in sync while the DNS propagates. This, of course, can a little tricky especially if the old site is on shared hosting.

I've always had good luck with the "redirect to the new host" trick, once the switch is flipped. For those folks who do have a cached record, you can make the HTTP server there redirect to something like "http://www2.example.com".

The trick being that "www2" didn't exist before you ventured down this path, which means your users will look it up and it will not be cached.

It takes a little work, but it can be convenient and seamless.

@jed:

I've always had good luck with the "redirect to the new host" trick, once the switch is flipped. For those folks who do have a cached record, you can make the HTTP server there redirect to something like "http://www2.example.com".

The trick being that "www2" didn't exist before you ventured down this path, which means your users will look it up and it will not be cached.

It takes a little work, but it can be convenient and seamless.

This is a great way of doing things and if you set your logging up correctly then you can even track how many people are still using the old website so you know when you can finally take it down.

One method I've heard of is to set up a reverse proxy on the old host, pointing to the new one. This obviously eats your bandwidth and adds latency, but it seems quite clever and fun to me. :D

Make sure you change your DNS TTL (time to live) to 5 minutes. This will cause servers to quickly invalidate your cache and retrieve your new values.

If you're using Linode's DNS servers, be aware they update the zone files every 15 minutes so you may want to try and time this.

This is what I do (and oddly enough I'm doing right now).

1) Point www.yourdomain.com to your old server

2) Point yourdomain.com to your new server

3) Set your webserver to redirect yourdomain.com to www.yourdomain.com

4) wait a few days for yourdomain.com to propagate

–if you have a database do the following--

5) Shutdown the www.yourdomain.com

6) Migrate the database do yourdomain.com

--

7) remove the redirect from yourdomain.com to www.yourdomain.com

8) add a redirect from www.yourdomain.com to yourdomain.com

9) point www.yourdomain.com to the new server

That way users will only see downtime if the site has a database that needs to be migrated, the only other thing they will notice is that the www. part goes missing.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct