Home » IIS » Child object ‘advancedLogging’ cannot be added to object ‘site’

Child object ‘advancedLogging’ cannot be added to object ‘site’

You can use Web Deploy tool to migrate your IIS websites from one server to another. I have been trying to transfer a site from Windows Server 2008 R2 to Windows Server 2016 server. I came across this error message:

Child object ‘advancedLogging’ cannot be added to object ‘site’. The ‘site’ provider may not support this deployment

Child object 'advancedLogging' cannot be added to object 'site'

Root Cause

This issue occurs because Advanced Logging extension is not available for IIS versions that are 8.5 or newer. Since this extension is not available, Web Deploy can’t import the package.

For a list of IIS versions, please check this post: A summary of IIS versions

Solution for “Child object ‘advancedLogging’ cannot be added”

In order to solve this issue, remove Advanced Logging from the source server. You can remove it via Programs and Features window.

Sample Web Deploy import and export commands are below for reference.

Export without a manifest file (run in the old server):

msdeploy -verb:sync -source:apphostconfig="Default Web Site" -dest:package=c:\backup\package.zip

Export with a manifest file (run in the old server):

msdeploy -verb:sync -source:manifest=c:\manifest.xml -dest:package=c:\backup\site-exported-with-manifest.zip

A sample manifest file:

<sitemanifest>	
  <appHostConfig path="test.com" />	
  <Contentpath path="E:\test_www" />
  <Contentpath path="E:\test_www2" />
</sitemanifest>	

Import (run in the new server):

msdeploy -verb:sync -source:package=c:\backup\package.zip -dest:appHostConfig="Site1"

If the 4GB limit in web deploy export causes an issue, check this post for alternative commands: How to migrate website between IIS servers using Web Deploy (msdeploy)

Alternative Solution

You can also try removing the Advanced Logging reference from the web deploy package to get over “Child object ‘advancedLogging’ cannot be added” error. Follow the steps below for this alternative solution:

  1. Unzip the web deploy package
  2. Remove Advanced Logging reference. Example: <advancedLogging directory="E:\Logfiles\AdvancedLogs\test.com" MSDeploy.MSDeployLinkName="advancedLogging" />
  3. Zip the folder
  4. Try to import it

Note: Depending on how you are importing the package, you may run into this error:

Error: Source <contentPath> and destination <sitemanifest> are not compatible for the giving operation

Error: Source <contentPath> and destination <sitemanifest> are not compatible for the giving operation

The root cause of this issue is that the type of the web deploy package changes if you unzip and zip it back. If you can’t get rid of this issue, you will have to use the main solution above (Remove Advanced Logging extension before exporting web deploy package).

In your old server, if the Advanced Logging is not working, check this solution: Advanced Logging is not working – Enable Advanced Logging per site. You may also see identical or wrong logs: IIS is logging 200 instead of 404 status code

Ned Sahin

Blogger for 20 years. Former Microsoft Engineer. Author of six books. I love creating helpful content and sharing with the world. Reach me out for any questions or feedback.
Categories IIS

1 thought on “Child object ‘advancedLogging’ cannot be added to object ‘site’”

  1. Another option is to add the ‘ -skip:objectname=advancedLogging’ command to your msdeploy sync command. This prevents it from trying to sync that section so no errors get thrown.

    Reply

Leave a Comment