• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2448
  • Last Modified:

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


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
boomtowncio
Asked:
boomtowncio
  • 3
  • 2
1 Solution
 
boomtowncioAuthor Commented:
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
 
Brad HoweCommented:
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
 
Brad HoweCommented:
Wrong question... Let me read this again :/

sorry,
Hades666
0
 
boomtowncioAuthor Commented:
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
 
boomtowncioAuthor Commented:
After an extensive amount of research and trial and error I ended up answering my own question
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now