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 :
- Put up a 'under maintenance' page on old host
- Get the site up and running on new host, and update domain to point to new host.
- 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.
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:
That would minimize downtime and the risk of surprises.
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!
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.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
See the Apache redirect docs to learn more about how to redirect and optionally rewrite the redirected location.