Solved

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
5
2,302 Views
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?
0
Comment
Question by:boomtowncio
  • 3
  • 2
5 Comments
 

Author Comment

by:boomtowncio
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
0
 
LVL 30

Expert Comment

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

http://technet.microsoft.com/en-us/library/dd569089(WS.10).aspx

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,
Hades666
0
 
LVL 30

Expert Comment

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

sorry,
Hades666
0
 

Accepted Solution

by:
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.
0
 

Author Closing Comment

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now