My Site Maintenence

Discussion in 'Site Programming, Development and Design' started by JackWebb, Oct 14, 2010.

  1. I asked support last night if there was a way to close my site for maintenance using the control panel.

    They said no, but I could do so using IIs7, suggesting that I pose the question here to find out how.

    So, I'm dutifully posing the question here!

    Ray, How do I use my IIS7 interface for my site to temporarily take my site out of service so that I can perform some maintenance?

    And while I'm at it, When i created a backup of my database, i got only the schema. How can I backup the data as well? So that I can a)backup the MS Sql Data/Schema, make changes to those, and re-Publish them back to the Winhost DB?

    Thanks so much,
    Jack Webb
    Last edited by a moderator: Oct 14, 2015
  2. Ray


    I guess the most effective and common way is to setup a HTTP redirect to some page that states under maintenance. Connect to our server using IIS 7 Manager and go to HTTP Redirect.

    Also we can manually stop your service for you but you'll have to let us know when you want us to restart it again. If you want to go this route open a ticket to our support request to have the service stop and that you'll let us know when you want it up. But I thing the HTTP Redirect is the way to go since you can control what the browsers see's when they pull up your site.
  3. thanks, Ray.

    Did you also note the second question about the DB maintenance?
  4. Ray


    Sorry I missed that part about the database.

    How exactly are you backing up your database, can you outline your steps?
  5. In Control Panel (This is what support told me to do)
    Home, Sites List, Site Manager, MS SQL 2008, Manage, in Tools: Backup
  6. Ray


    This is taking a backup of your database uploaded on our SQL 2008 server. If you only have a schema available, that is all it is going to backup. But I had an understanding that you are trying to take a backup of your local database on your own personal computer. Isn't that what you are trying to do? Take a backup of your database on your local computer and restore it to our SQL server?
  7. No.
    I want to backup the MS SQL data from the Winhost site, and download that to my computer.
    Then I can make mods to the DB on my computer, and the re-Publish it back to the Production Site.
    Last edited by a moderator: Oct 14, 2015
  8. Ray


    Have you checked the database you uploaded to our server. You said all you see is nothing but schema but our Backup tool will back up all the objects and data on our SQL server so if that's all you have thats what you'll restore on your own local computer. Try connecting to our SQL server with SQL Server Management Studio and verify exactly what you have on our SQL server.
    Last edited by a moderator: Oct 14, 2015
  9. Ray


  10. I only put the page name of "SiteMaintenance.aspx" into the Textbox under the Redirect requests to this destination Checkbox.

    Attached Files:

  11. Ray


    Can you drop that http redirect rule for now and see what happens? There can be another redirect rule that you are not aware of existing in your code somewhere.
  12. As you can see, the checkbox is left unchecked. which I assume means that it is not in effect. And when i go to, it does go to the normal place, i.e., default.aspx.

    When I check the box for Redirection, logging in never resolves, it just shows as an infinite loop of trying to go to :
  13. Ray


    Try typing this at the top of the page default.aspx

    Response.Redirect ""
  14. (Thumping my forehead as the lightbulb turns on) AHHHHH. Yes of course. How simple!

    I don't even need to mess with IIS 7.
  15. Morning Ray,
    On the two points of this thread, weekend tests produced the following fruit:
    1) I can't change the default.aspx page; the webapp is a compiled application, precluding making changes to it diectly. Meaning I'd have to publish a new copy, which requires putting the site into maintenance mode. It's a circular argument.

    2) Database Backup. Following instructions from the Winhost, I ran the backup and it put a backup copy into the app_data folder. The problem here is the following note in the instructions: "Note however that the backup files are intended for restoration to our servers, and we cannot provide support for using the database backup on your local system."

    So, the long and short of this is the problem where I need a copy of the data; to a) propagate to the test website for testing enhancements, and/or b) the ability to Download the Database, alter it's schema to support enhancements, and republish to production after Quality Assurance testing in the Test Website.

    Last edited by a moderator: Oct 14, 2015
  16. Ray


    You should have several options for this. I think the easiest way is to setup the redirect script as its own page, call it redirect.asp (or something like that). Go to IIS 7 Manager connect to our server and go to the module Default Docs and place that page "redirect.asp" at the top of the list. That way redirect.asp is the default page that IIS will serve when a browser calls on your domain name.

    Another method is using the URL Rewrite module instead of the HTTP redirect module.

    Go to the URL Rewrite module, Add Rules, choose Blank Rule.

    Try looking at some of these threads from the forum. It gives some instruction on how to setup the URL Rewrite rule. Now, don't get confused with the name. The URL Rewrite module also does a good job with Redirects.

    This is just a disclamer. For the most part you can take the backup we generate for you and restore it on your own PC/Local Database. But some personal database are configured so elaboratly that no backup can be restored on them. You can imagine if we provide support to those types of personal/local database. It will be almost impossible to support not to mention open us to a lot of liability issues.
    Last edited by a moderator: Oct 14, 2015
  17. Ray,
    On the Database front:
    Thanks for the tip about it being a disclaimer. Since it was an MS SQL Backup, it restored into my local machine quite easily.

    We can consider this part of the thread as CLOSED!


    PS, I'll test the other end of the thread tonight, non business hours.
  18. Ray,

    I found the answer to the SiteMaintenance problem. And it doesn't involve IIS 7, nor does it involve my compiled Web Application. Per the below post, I got rid of my SiteMaintenance,aspx and added an "_app_offline.htm" page. Then since this doesn't get compiled, all I have to do is rename it to "app_offline.htm" using ftp, and voila, Site Maintenance page shows up. Likewise, renaming it back tells ASP.NET to do things normally.

    Thanks for all your help, and I'll bet someone in the future will eventually have this question.
    Jack Webb

    Here's the post:

    If you have an ASP.NET web application site, and you place a text file named "app_offline.htm" in the root of the site, all requests to that website will redirect to that app_offline.htm file. Basically, if you need to take an entire ASP.NET site offline, you can place some nice message in that file. Then, any new requests to a URL, any URL, in that website will redirect to that file allowing you to do maintenance to the site, upgrades, or whatever. It is not really a redirect though. ASP.NET essentially shuts down the site, unloads it from the server, and stops processing any requests to that site. That is, until you delete the app_offline.htm file - then things will continue as normal and your ASP.NET site will load up and start serving requests again.

    A super-cool side effect of this is that any files that are locked by the site, such as a database or other resources, are freed since the application domain has been unloaded from the server. This allows you to remove the locks from those files and replace them, without the need to do a full IISRESET, taking down other sites on the server. One thing to keep in mind with this file however, make sure you out enough content in it so it is larger than 512 bytes or IE will consider it a 404 and will display the 404 instead of the contents of your app_offline.htm file.

    And the link is:
  19. Oh, and I thought I may as well provide and example:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="" >
    <style type="text/css">
    font-family: Verdana;
    font-size: x-large;
    text-align: center;
    <form id="form1" runat="server">
    <h2 class="style2">
    <br class="style1" /><span class="style1">The xyz Company Web Site is down for a short Maintenance Moment</span><br class="style1" />It will be back as soon as possible<br class="style1" />Please try again in a little while<br class="style1" />
  20. Thanks for posting that.

Share This Page