Client Login Area
Main Menu
Results 1 to 3 of 3

Thread: How To: Backup IIS7 ApplicationHost.config and Settings

  1. #1
    ASPnix Administration Roma's Avatar
    Join Date
    June 27, 2005
    Location
    Denver, CO
    Posts
    4,066

    Lightbulb How To: Backup IIS7 ApplicationHost.config and Settings

    Internet Information Services 7 (IIS7) doesn't use metabase-like file from IIS6. Instead the settings and configuration are stored in schema files and applicationHost.config files.

    Since the configuration files are different, the old IIS6 tools will not be able to backup IIS7 settings.

    This is the new script that you can use to backup your IIS7 web servers.

    1. Using notepad or any text editor create a file backupiis7.cmd

    2. Insert the following code and save the file:

    Code:
    @echo off
    cls
    
    pushd "%WinDir%\System32\inetsrv"
    
    echo.| date | find /i "current">datetime1.tmp
    echo.| time | find /i "current">datetime2.tmp
    
    for /f "tokens=1,2,3,4,5,6" %%i in (datetime1.tmp) do (
      echo %%n>datetime1.tmp
    )
    for /f "tokens=1,2,3,4,5,6" %%i in (datetime2.tmp) do (
      echo %%m>datetime2.tmp
    )
    for /f "delims=/ tokens=1,2,3" %%i in (datetime1.tmp) do (
      set TMPDATETIME=%%k%%i%%j
    )
    for /f "delims=:. tokens=1,2,3,4" %%i in (datetime2.tmp) do (
      set TMPDATETIME=D%TMPDATETIME%T%%i%%j%%k%%l
    )
    
    appcmd add backups %TMPDATETIME%
    
    del datetime1.tmp
    del datetime2.tmp
    
    set TMPDATETIME=
    
    popd
    echo.
    3. The IIS7 configuration will be backed up at the following path:

    Code:
    C:\Windows\System32\inetsrv\backup
    NOTE: you can also use Task Scheduler to automate backups.
    Roma
    Friendly ASPnix Administrator


    https://www.aspnix.com
    roma@aspnix.com



    ASPnix on Facebook

  2. #2
    Unverified User
    Join Date
    October 4, 2010
    Posts
    1

    Default

    Thanks for the script, but when executing this on a windows 2008 server i get the following: Failed to process input: The parameter 'is' must begin with a / or - (HRESULT=80070057).

    Any help would be much appreciated...

  3. #3
    ASPnix Administration Roma's Avatar
    Join Date
    June 27, 2005
    Location
    Denver, CO
    Posts
    4,066

    Default

    I have tested the script and we run it on all our servers. Please make sure you copied it correctly.
    Roma
    Friendly ASPnix Administrator


    https://www.aspnix.com
    roma@aspnix.com



    ASPnix on Facebook

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •