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:

@echo off

pushd "%WinDir%System32inetsrv"

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 (

appcmd add backups %TMPDATETIME%

del datetime1.tmp
del datetime2.tmp



3. The IIS7 configuration will be backed up at the following path:


NOTE: you can also use Task Scheduler to automate backups.

One thought on “How To: Backup IIS7 ApplicationHost.config and Settings”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>