How do you migrate an IIS 7 site to another server?

前端 未结 7 2103
梦如初夏
梦如初夏 2020-12-22 16:59

I\'m wondering what is the best practice for moving a website to another server (along with all settings, etc.)

  • Manually recreate the site on the new server (n
相关标签:
7条回答
  • 2020-12-22 17:23

    In my case, the files were already copied, I found the easiest way to follow the steps in this guide: https://www.ryadel.com/en/exporting-importing-app-pools-and-websites-configuration-between-multiple-iis-instances/

    I exported AppPools/Websites, copied the xml files to the destination server and Imported AppPools then Websites. Worked very well. This is also another excellent option for this question.

    0 讨论(0)
  • 2020-12-22 17:26

    I can't comment up thread due to lack of rep. Another commenter stated they couldn't migrate from a lower version to a higher version of IIS. This is true if you don't merge some files, but if you do you can as I just migrated my IIS 7.5 site to IIS 8.0 using the answer posted by chews.

    When the export is created (II7.5), there are two key files (administration.config and applicationHost.config) which have references to resources on the IIS7.5 server. For example, a DLL will be referred with a public key and version specific to 7.5. These are NOT the same on the IIS8 server. The feature configuration may differ as well (I ensured mine were identical). There are some new features in 8 which will never exist in 7.5.

    If you are brave enough to merge the two files - it will work. I had to uninstall IIS once because I messed it up, but got it the second time.

    I used a merge tool (Beyond Compare) and without something equivalent it would be a huge PITA - but was pretty easy with a good diff tool (five minutes).

    To do the merge, the 8.0 files need to be diffed against the exported 7.5 files BEFORE an import is attempted. For the most part, the 8.0 files need to overwrite the server specific stuff in the exported 7.5 files, while leaving the site/app pool specific stuff.

    I found that administration.config was almost identical, sans the version info of many entries. This one was easy.

    The applicationHost.config has a lot more differences. Some entries are ordered differently, but otherwise identical, so you will have to pick through each difference and figure it out.

    I put my 7.5 export files in the System32\inetsrv\config\Export folder prior to merging.

    I merged FROM folder System32\inetsrv\config to folder System32\inetsrv\config\Export for both files I mentioned above. I pushed over everything in the FROM files except site specific tags/elements (e.g. applicationPools, customMetadata, sites, authentication). Of special note, there were also many site specific "location" tag blocks that I had to keep, but the new server had its own "location" tag block with server specific defaults that has to be kept.

    Lastly, do note that if you use service accounts, these cached passwords are junk and will have to be re-entered for your app pools. None of my sites worked initially, but all that was required was re-entering the passwords for all my app pools and I was up and running.

    If someone who can comment mention this post down thread - it will probably help someone else like me who has many sites on one server with complicated configurations.

    Regards,

    Stuart

    0 讨论(0)
  • 2020-12-22 17:30

    Microsoft Web Deploy v3 can export and import all your files, the configuration settings, etc. It puts it all into a zip archive ready to import on the new server. It can even upgrade to newer versions of IIS (v7-v8).

    http://www.iis.net/extensions/WebDeploymentTool

    After installing the tool: Right click your server or website in IIS Management Console, select 'Deploy', 'Export Application...' and run through the export.

    On the new server, import the exported zip archive in the same way.

    0 讨论(0)
  • 2020-12-22 17:33

    use appcmd to export one or all the sites out then reimport into the new server. It could be iis7.0 or 7.5 When you export out using appcmd, the passwords are decrypted, then reimport and they will reencrypt.

    0 讨论(0)
  • 2020-12-22 17:38

    I'd say export your server config in IIS manager:

    1. In IIS manager, click the Server node
    2. Go to Shared Configuration under "Management"
    3. Click “Export Configuration”. (You can use a password if you are sending them across the internet, if you are just gonna move them via a USB key then don't sweat it.)
    4. Move these files to your new server

      administration.config
      applicationHost.config
      configEncKey.key 
      
    5. On the new server, go back to the “Shared Configuration” section and check “Enable shared configuration.” Enter the location in physical path to these files and apply them.

    6. It should prompt for the encryption password(if you set it) and reset IIS.

    BAM! Go have a beer!

    0 讨论(0)
  • 2020-12-22 17:40

    MSDeploy can migrate all content, config, etc. that is what the IIS team recommends. http://www.iis.net/extensions/WebDeploymentTool

    To create a package, run the following command (replace Default Web Site with your web site name):

    msdeploy.exe -verb:sync -source:apphostconfig="Default Web Site" -dest:package=c:\dws.zip > DWSpackage7.log
    

    To restore the package, run the following command:

    msdeploy.exe -verb:sync -source:package=c:\dws.zip -dest:apphostconfig="Default Web Site" > DWSpackage7.log
    
    0 讨论(0)
提交回复
热议问题