Use Web Deploy 2.0 (msdeploy) to Migrate Web Server from IIS 7.0 32-bit to IIS 7.5 64-bit

Posted on 2011-09-05
Medium Priority
Last Modified: 2012-05-12

My goal is to move an entire web/application server from a 32-bit machine running Windows Web Server 2008 (IIS 7.0 - Version 6.0, Build 6002: Service Pack 2) to a 64-bit machine running Windows Web Server 2008 R2 (IIS 7.5 - Version 6.1, Build 7601: Service Pack 1)

I have installed Web Deploy 2.0 on both the source and destination machines and confirmed that the service is running on both, set to start automatically and running under the Network Service account. I have also successfully created the server export with no known errors using the following command:

msdeploy -verb:sync -source:webServer -dest:archiveDir=d:\exportedfiles,encryptPassword=mypassword

I have copied the entire folder d:\exportedfiles to the c: drive of the destination server.

Running an administrative (elevated) command prompt, I am trying to execute the following command to import the server to the new machine:

msdeploy -verb:sync -source:archiveDir=c:\exportedfiles,encryptPassword=mypassword -dest:auto -whatif

The destination server is a domain member and I am logged in to the machine using the built-in domain administrator account (DOMAIN\administrator). I have also added the DOMAIN\administrator account to the Local Administrators group on the destination server.

I have confirmed that the DOMAIN\administrator account has full access permissions to the c:\exportedfiles folder and all sub-directories and files.

The following is the error message that I keep receiving:

Error: Object of type 'archiveDir' and path 'c:\exportedfiles' cannot be created.
Error: The archive directory 'c:\exportedfiles' could not be loaded.
Error: The XML file 'c:\exportedfiles\archive.xml' could not be loaded.
Error: The 'location' start tag on line 64 does not match the end tag of 'section'. Line 181, position 11.
Error count: 1.

Running the previous command with -debug operator, the result is as follows:

Microsoft.Web.Deployment.DeploymentException: Object of type 'archiveDir' and pa
th 'c:\exportedfiles' cannot be created. ---> Microsoft.Web.Deployment.Deploymen
tException: The archive directory 'c:\exportedfiles' could not be loaded. ---> M
icrosoft.Web.Deployment.DeploymentException: The XML file 'c:\exportedfiles\arch
ive.xml' could not be loaded. ---> System.Xml.XmlException: The 'location' start
 tag on line 64 does not match the end tag of 'section'. Line 181, position 11.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
   at System.Xml.XmlTextReaderImpl.ParseEndElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at Microsoft.Web.Deployment.ArchiveXmlDocument.Load(Stream stream, String path)
   --- End of inner exception stack trace ---
   at Microsoft.Web.Deployment.ArchiveXmlDocument.Load(Stream stream, String path)
   at Microsoft.Web.Deployment.ArchiveXmlDocument.Load(String path)
   at Microsoft.Web.Deployment.ArchiveProvider..ctor(DeploymentProviderContext providerContext, DeploymentBaseContext baseContext, String path)
   --- End of inner exception stack trace ---
   at Microsoft.Web.Deployment.ArchiveProvider.GetAttributes(DeploymentAddAttributeContext addContext)
   at Microsoft.Web.Deployment.DeploymentObject.EnsureValidAttributes()
   --- End of inner exception stack trace ---
   at Microsoft.Web.Deployment.DeploymentManager.CreateObjectPrivate(DeploymentProviderContext providerContext, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject)
   at Microsoft.Web.Deployment.DeploymentManager.CreateObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions)
   at MSDeploy.MSDeploy.CreateObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions)
   at MSDeploy.MSDeploy.ExecuteWorker()
   at MSDeploy.MSDeploy.Execute()
   at MSDeploy.MSDeploy.Main(String[] unusedArgs)
Error count: 1.

What am I missing here to get this import to run successfully?
Question by:boomtowncio
  • 3
  • 2

Author Comment

ID: 36486392
Since my last post, I have also tried "pulling" the deployment package to the destination server (both of these commands were executed on the destination server) but still have the same error when attempting to import:

This runs successfully:
msdeploy -verb:sync -source:webserver,computername=WWW6 -dest:archiveDir=c:\export,encryptPassword=mypassword > msdeployexport.log

This fails with the same error as before:
msdeploy -verb:sync -source:archiveDir=c:\export,encryptPassword=mypassword -dest:auto > msdeployimport.log
LVL 30

Expert Comment

by:Brad Howe
ID: 36959106
As mentioned in your other post.  You need to include the -enableLink option.


On source:
msdeploy.exe -verb:sync -source:appHostConfig="Default Web Site",encryptpassword=somepass -dest:archiveDir="D:\Sites\Default Web Site",encryptpassword=somepass  -enableLink:AppPoolExtension

On destination (after archive is copied over):
msdeploy.exe -verb:sync -source:archiveDir:"D:\Sites\Default Web Site",encryptpassword=somepass -dest:appHostConfig="Default Web Site",encryptpassword=somepass

let us know,
LVL 30

Expert Comment

by:Brad Howe
ID: 36959107
Wrong question... Let me read this again :/


Accepted Solution

boomtowncio earned 0 total points
ID: 36977658
I ended up answering my own question. The solution is as follows:

Before importing, the following edits must be made to the archive.xml file when migrating from IIS 7.0 32-bit to IIS7.5 64-bit:
Fields not compatible for import in archive.xml:

1. Under section name="system.webServer/httpCompression", comment out the entry for scheme name="deflate". e.g.
<!--<scheme name="deflate" MSDeploy.name="2" doStaticCompression="true" doDynamicCompression="true" MSDeploy.doDynamicCompression="1" dll="%windir%\system32\inetsrv\gzip.dll" MSDeploy.dll="8" staticCompressionLevel="9" dynamicCompressionLevel="9" MSDeploy.MSDeployKeyAttributeName="name" />-->

2. Comment out any section name="system.webServer/httpErrors" entries as importing custom error pages is not supported.
Not commenting out these elements will result in the following error message when importing:
"Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Other notes:

3. After import, manually set all application pools to 32-bit True as they will be imported as False.

4. Manually need to set-up any custom error pages for the imported sites as they were commented out in the archive.xml file and not imported.

Be sure to comment out the ENTIRE <section name="system.webServer/httpErrors" . . . /section>
This can span numerous lines. If not will get the following error:
Error: Object of type 'archiveDir' and path 'c:\exportedfiles' cannot be created.
Error: The archive directory 'c:\exportedfiles' could not be loaded.
Error: The XML file 'c:\exportedfiles\archive.xml' could not be loaded.
Error: The 'location' start tag on line 64 does not match the end tag of 'section'. Line 181, position 11.
Error count: 1.

Author Closing Comment

ID: 37005174
After an extensive amount of research and trial and error I ended up answering my own question

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question