1

my site has outgrown the shared hosting account it's on and i've setup a VPS that i'll be moving to soon. I cannot keep the same IP between my new account and the old one and I'm a bit at loss as to how to minimize user downtime while the new IP is reflected in all DNS caches. Note I cannot have the site running on both accounts at the same time as it's a dating site and this would cause data inconsistency.

Here's what i am planning to do :

  1. Put up a 'under maintenance' page on old host
  2. Get the site up and running on new host, and update domain to point to new host.
  3. Hope downtime isn't too long.

Would it be a good idea to have a link on the page in (1) that opens the new site but using it's ip ? Or even redirect all requests at the old host, to the new one (again by ip) ?

Any advice much appreciated.

1

4 Answers 4

2

One thing you can do is go right now and decrease the cache time (TTL) of your domain's records to 10 minutes or so. Then when you make the change, the old IP should only hang around for 10 minutes (plus whatever was cached before you made the change if you had a really long TTL previously).

Other than that, the only thing I'd say is that I'd do it this way:

  1. Get the site up and running on the new host using an old copy of the database for testing (you can test the site by using your hosts file to set an IP for the hostname manually)
  2. (Preferrably at about 3AM in whatever timezone most of your users are in) Put up the under construction page
  3. Copy the current database to the new host and test.
  4. Update DNS.

That would minimize downtime and the risk of surprises.

3
  • Thanks for your reply. The current site is on a shared host, do i have control over the TTL of my domain's records ? Jan 7, 2011 at 20:55
  • @Sherif: the TTL is part of the domain configuration, not the site configuration, so wherever you're going to change the IP address, that's the place you should go for the TTL. I assume this would be the registrar you registered the domain with if you're not running your own DNS server.
    – DerfK
    Jan 7, 2011 at 23:30
  • thanks, should have looked before asking and looking like a total dufus :) Jan 7, 2011 at 23:52
1

Don't worry about linking by IP, it could end up confusing your users.

Honestly, it sounds like you've got it planned out right, the only thing you'll want to do is ANNOUNCE ahead of time to your users the scheduled maintenance, migration, and downtime. They really do appreciate it, and it'll minimize your emails from users regarding the downtime.

Then, make the move and DNS change as fast as possible. DNS'll catch up. Usually only takes 24 hours at the most.

Good luck, and let us know if you have any other concerns!

4
  • You can't just spout any random time frame, like 24 hours. It's completely dependent on the TTL of the DNS records being changed. No more, no less. (I'm not picking on you this week, my apologies if it seems that way).
    – joeqwerty
    Jan 7, 2011 at 18:12
  • @joe, it kinda does! :P Just playing. The 24 hours came from my own personal experience, nothing more. He's right, @Sherif, there is no 'set time' that it will take, but IN MY EXPERIENCE 24 hours is usually sufficient.
    – JohnThePro
    Jan 7, 2011 at 18:14
  • We'll be old friends by the time the week is up. I'm dreading the day you catch me in a slip up. :)
    – joeqwerty
    Jan 7, 2011 at 18:28
  • Tick tock. The sound of impending DOOM. :)
    – JohnThePro
    Jan 7, 2011 at 18:32
1

In the past, I've augmented the DNS tricks by making the old host transparently proxy traffic to the new one. That way, clients who hit the old IP will still see the right thing. This is easy with a web server using Apache's mod_proxy or something.

2
  • My old host is on a shared server, would that be possible? Jan 14, 2011 at 13:36
  • If you have access to your apache config, probably. If not... probably not. Maybe you could hack something together using mod_rewrite's proxy mode and .htaccess?
    – Bill Weiss
    Jan 14, 2011 at 23:12
0

DerfK's TTL advice is good.

If you only have one main site and it will be served under a new ip address, you can run both sites concurrently, but redirect the old site to the new one by using the ip address as the redirect target.

Something like this in Apache

Redirect permanent / http://192.168.2.1/

See the Apache redirect docs to learn more about how to redirect and optionally rewrite the redirected location.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .