Sunday, March 11, 2012

IIS Backup/Restore in SharePoint

IIS backup is the vital part in SharePoint disaster recovery. SharePoint in-built backup mechanisms (either STSADM or Central Admin Backup Wizard) doesn't touch IIS at all.

In IIS6 under Windows Server 2003, this configuration data was maintained in a database known as the IIS Metabase. With Windows Server 2008 and IIS7, the Metabase has been replaced by a set of XML configuration files that are located in the %WINDIR%\System32\Inetsrv\Config folder.

Windows 2008 Options to backup restore IIS for SharePoint 2010/MOSS 2007:

Windows 2008 offers an excellent command line interface for IIS: Appcmd.exe, which resides under: %WINDIR%\System32\inetsrv folder. Here is how you can backup restore IIS 7 configuration.

To Backup IIS:
appcmd add backup  <name-for-backup-folder>

To Restore IIS configuration from backup:
appcmd restore backup <name-of-backup-folder>

use appcmd /? for other available options.

PowerShell Way to Backup/Restore IIS:
To get the IIS cmd-lets, we have to import WebAdministration Module in Powershell. This module get installed while we add IIS role to the server, but will not activated by default. So, Lets activate the IIS cmd-lets by importing:

import-module WebAdministration

To Backup IIS:
Backup-WebConfiguration -Name <Name-Of-the-Backup>

This will backup IIS and the backup will be saved under: c:\Windows\System32\inetsrv\backup
iis backup restore configuration

To Restore IIS:
Restore-WebConfiguration -Name <Name-Of-the-Backup>

View existing backups:
Get-WebConfigurationBackup
iis backup restore config powershell


IIS Cmdlets: http://technet.microsoft.com/en-us/library/ee790599.aspx

Need UI?
IIS 7 doesn't include user interface for backup restore. But you can download the "Backup/Restore UI Module" from http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1892, But not sure about the reliability since it wont be.

MOSS 2007- Windows 2003 IIS Backup Options:


1. IISBack :shipped with windows 2003, located at: C:\WINDOWS\system32\

Usage:
Backup:
iisback /s <ServerName> /u Administrator /p <AdminPassword> /backup /b IISBackupUp /overwrite

Restore:
iisback /restore /s <server-Name> /u <User-Name> /p <password> /b <backup-name>

while backup the IIS, You got to give the password. This is called "portable backup", and you will be able to restore the backup on different servers. If you don't give, you will be able to backup, but it wont allow you to restore on other servers! This is called non-portable backup, because the machine key is used and we'll have to restore it to the same machine.

More info: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5e7e923c-b374-4872-a8f5-da85ec1315fd.mspx?mfr=true

KB on How To Create a Metabase Backup: http://support.microsoft.com/kb/324277

2. Using IIScnfg.vbs:
IIS 6 backup restore configuration:
Compared with iisback - IIScnfg.vbs with Import/Export gives you a lot of options. You can Export/Import using command line: IIScnfg, Its actually a VBScript shipped with windows 2003. You have to register the IIScnfg once before using it. (Just type IIScnfg, which will pop a msgbox with "This script does not work with WScript" and then another with confirmation, finally success msg)
iis 6 backup restore configuration

To Backup IIS 6 Metabase:
IIScnfg /export /sp /lm /children /inherited /d <password> /f c:\IISconfig.bak

Restore:
IISCNFG /import /dp /lm /sp /lm /children /inherited /d <password> /f c:\IISconfig.bak

More Info on IISBack & IIScnfg: http://technet.microsoft.com/en-us/library/cc727916%28v=ws.10%29.aspx

Backup/Restore via UI:
    1) Open IIS Manager (Start > Run > Inetmgr)
    2) Right Click on Local Computer > All Tasks > Backup/Restore Configuration
    3) Click on "Create Backup" and then provide name for Backup, Provide Password and click OK.
    4) This will create two files with .SC0 and MD0 extentions under c:\windows\system32\inetsrv\MetaBack folder

iis backup restore tool
iis 6 backup and restore
 
Restoring IIS 6.0 Metabase:
    1) Copy the files created during backup  to your existing/new server.
    2) Open IIS Manager
    3) Right Click on Local Computer > All Tasks > Backup/Restore Configuration
    4) Select the file you want to restore and then provide the password
iis backup restore
How about Home directories (Inetpub), Customized Web.config, Digital certificates & Addons?

All these techniques discussed above will **NOT** backup your IIS Home directories/Files. You have to have a File system backup for IIS Virtual directories.

If your solution package copies, retracts the customizations in Proper way, the below steps may not be necessary. You may be having customizations like assemblies, resource files, site maps, etc in your IIS folders (like _app_bin), IIS Add-ons (like URL Rewrite Module), compressions, etc. Make a clear documentation of all of these and

SSL Certificates:

SSL certificates provides secure HTTS communications between SharePoint and client browsers. SSL Certificates are not stored within Web sites or captured when an IIS configuration backup is performed, IIS just keeps the association between the site & certificates, which usually will reside under server's local disk. In case of a disaster, we must restore the certificates configuration.

Technet Article on Backup/Restore IIS 6.0 in windows 2003:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/131b609d-ff3a-488f-a8dd-13044fa623a1.mspx?mfr=true



Third party solutions: There are many third party solutions available to fill the gap:
  1. SCDPM
  2. Commvault
Last but not least: There are lot of PowerShell code to Backup and Zip IIS. Here is one such: http://www.olavaukan.com/2011/03/how-to-backup-and-restore-iis-7-metabase-with-powershell/



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...