Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Copying Websites Between Servers - IIS

RSS
Modified on Thu, Apr 21, 2016, 12:34 PM by Administrator Categorized as Windows (OS, IE, IIS, and MSMQ)

Overview

To copy websites between servers, it is straightforward enough to copy the files via Windows Explorer. However, copying the IIS setup is a bit more involved. This article explains how.

This article was adapted from http://www.microsoftpro.nl/2011/01/27/exporting-and-importing-sites-and-app-pools-from-iis-7-and-7-5/

Procedure

Before running the appcmd command, change directory to the %windir%\system32\inetsrv folder.

Copying App Pools

1. Export App Pools from the Source Server

appcmd list apppool /config /xml > c:\AppPools.xml

This will create the specified XML file.

2. Edit the AppPools.xml File

Remove any app pools from the XML file that you don't need to copy (e.g., DefaultAppPool, Classic .NET AppPool, SecurityTokenServiceApplicationPool, etc.).

NOTE: If any app pool in your AppPools.xml file already exist on the target server, NONE of them will be imported.

3. Import App Pools to the Target Server

appcmd add apppool /in < c:\AppPools.xml

Copying the Websites

1. Export the Websites from the Source Server

appcmd list site /config /xml > c:\sites.xml

2. Edit the Sites.xml file

Remove any sites from the XML file that you don't need to copy, including sites that already exist on the target server.

3. Import the Websites on the Target Server

appcmd add site /in < c:\sites.xml

Additional Commands

Exporting a single app pool

appcmd list apppool “MyAppPool” /config /xml > c:\myapppool.xml

Exporting a single website

appcmd list site “MyWebsite” /config /xml > c:\mywebsite.xml

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.