如何将 IIS 7 站点迁移到另一台服务器?

发布于 2024-07-12 13:45:19 字数 232 浏览 9 评论 0原文

我想知道将网站移动到另一台服务器的最佳实践是什么(以及所有设置等)

  • 在新服务器上手动重新创建网站(由于明显的原因而无法维护)
  • 复制 applicationHost.config 设置文件
  • 使用 appcmd 来进行备份和恢复
  • 使用 MSDeploy 在新计算机上发布站点
  • 使用第 3 方工具

只是想知道其他人的体验如何。

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 (not maintainable for obvious reasons)
  • Copy the applicationHost.config settings file
  • Use appcmd to make a backup and restore
  • Use MSDeploy to publish the site on the new machine
  • Use a 3rd party tool

Just wondering what others' experiences have been.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

入怼 2024-07-19 13:45:19

我想说的是在 IIS 管理器中导出服务器配置:

  1. 在 IIS 管理器中,单击服务器节点
  2. 转到“管理”下的共享配置
  3. 单击“导出配置”。 (如果您通过互联网发送它们,则可以使用密码,如果您只是想通过 USB 密钥移动它们,那么不要担心。)
  4. 将这些文件移动到您的新服务器

    administration.config 
      应用程序主机配置 
      配置EncKey.key  
      
  5. 在新服务器上,返回“共享配置”部分并选中“启用共享配置”。 输入这些文件的物理路径位置并应用它们。

  6. 它应该提示输入加密密码(如果您设置了)并重置 IIS。

嘭! 去喝杯啤酒吧!

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!

瞄了个咪的 2024-07-19 13:45:19

MSDeploy 可以迁移所有内容、配置等,这是 IIS 团队推荐的。 http://www.iis.net/extensions/WebDeploymentTool

要创建包,请运行以下命令命令(将默认网站替换为您的网站名称):

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

要恢复包,请运行以下命令:

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

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
明天过后 2024-07-19 13:45:19

这是一个有关使用 appcmd 导出/导入站点配置的有用网站。
http ://www.microsoftpro.nl/2011/01/27/exporting-and-importing-sites-and-app-pools-from-iis-7-and-7-5/

Here is a helpful website on using appcmd to export/import a site configuration.
http://www.microsoftpro.nl/2011/01/27/exporting-and-importing-sites-and-app-pools-from-iis-7-and-7-5/

oО清风挽发oО 2024-07-19 13:45:19

Microsoft Web Deploy v3 可以导出和导入所有文件、配置设置等。它将所有内容放入 zip 存档中,准备导入到新服务器上。 它甚至可以升级到较新版本的 IIS (v7-v8)。

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

安装后工具:
在 IIS 管理控制台中右键单击您的服务器或网站,选择“部署”、“导出应用程序...”并运行导出。

在新服务器上,以相同的方式导入导出的 zip 存档。

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.

徒留西风 2024-07-19 13:45:19

由于缺乏代表,我无法评论主题。 另一位评论者表示他们无法从较低版本的 IIS 迁移到较高版本的 IIS。 如果您不合并某些文件,这是正确的,但如果您这样做,您就可以,因为我刚刚使用 Chews 发布的答案将我的 IIS 7.5 站点迁移到 IIS 8.0。

创建导出 (II7.5) 时,有两个关键文件(administration.config 和 applicationHost.config),它们引用了 IIS7.5 服务器上的资源。 例如,DLL 将使用公钥和特定于 7.5 的版本进行引用。 这些在 IIS8 服务器上并不相同。 功能配置也可能有所不同(我确保我的配置是相同的)。 8 中有一些新功能在 7.5 中永远不会存在。

如果您有足够的勇气合并这两个文件 - 它会起作用。 我不得不卸载 IIS 一次,因为我把它弄乱了,但第二次就卸载了。

我使用了一个合并工具(Beyond Compare),如果没有等效的工具,它将是一个巨大的 PITA - 但使用一个好的 diff 工具就很容易了(五分钟)。

要进行合并,在尝试导入之前需要将 8.0 文件与导出的 7.5 文件进行比较。 在大多数情况下,8.0 文件需要覆盖导出的 7.5 文件中服务器特定的内容,同时保留站点/应用程序池特定的内容。

我发现 Administration.config 几乎相同,没有许多条目的版本信息。 这很容易。

applicationHost.config 还有很多差异。 有些条目的顺序不同,但其他方面是相同的,因此您必须找出每个差异并找出答案。

在合并之前,我将 7.5 导出文件放入 System32\inetsrv\config\Export 文件夹中。

我将上面提到的两个文件的 FROM 文件夹 System32\inetsrv\config 合并到文件夹 System32\inetsrv\config\Export 。 我推送了 FROM 文件中除特定于站点的标签/元素(例如 applicationPools、customMetadata、站点、身份验证)之外的所有内容。 特别值得注意的是,还有许多我必须保留的特定于站点的“位置”标记块,但是新服务器有自己的“位置”标记块,其中必须保留服务器特定的默认值。

最后,请注意,如果您使用服务帐户,这些缓存的密码都是垃圾,必须为您的应用程序池重新输入。 我的网站最初都无法工作,但所需要做的就是重新输入所有应用程序池的密码,然后我就可以启动并运行了。

如果有人可以评论在线程中提及这篇文章 - 它可能会帮助像我这样在一台服务器上拥有许多具有复杂配置的站点的人。

问候,

斯图尔特

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

莫多说 2024-07-19 13:45:19

使用 appcmd 导出一个或所有站点,然后重新导入到新服务器中。 可能是 iis7.0 或 7.5 当您使用 appcmd 导出时,密码将被解密,然后重新导入,它们将重新加密。

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.

梦罢 2024-07-19 13:45:19

就我而言,文件已被复制,我找到了按照本指南中的步骤操作的最简单方法:https://www.ryadel.com/en/exporting-importing-app-pools-and-websites-configuration- Between-multiple- iis-instances/

我导出了 AppPools/网站,将 xml 文件复制到目标服务器,然后导入了 AppPools 和网站。 效果很好。 这也是这个问题的另一个很好的选择。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文