Is there a preferred method of gracefully upgrading a web site? I have a completely new code base ready to go on a site, but updating it will take several hours. I don't want the site to be down the entire time with a "Upgrading, be back soon!" message, but neither can I leave the current site up while the new one is put in place.
The only way I can think of that might allow for a graceful upgrade is through the use of two servers, but this would get more expensive.
Planning to "gracefully upgrade your website" doesn't start when you're ready to deploy. It starts very early in the design of your application. That means you have to build an application that can be upgraded gracefully, and also having the infrastructure in place to support that upgrade.
You have provided few details and are asking a vague, but important question from random people on the internet. This leads me to believe that "upgrading gracefully" was a last minute concern (like 23 minute ago).
Your question, "Is there a preferred method of gracefully upgrading a web site?" can only be answered as, "Yes, but I do it way differently than you do."