两台服务器共享磁盘网络驱动器模式

中间一直因为这样,那样的权限问题而导致失败,最后经下面操作成功解决!


两台服务器,全为08R2,IIS7,备份完A机,在B机还原后不能给网站分配用户名和密码,分配完没办法保存,网上搜半天不得要领,后在一MSDN上找到,原来还要备份A机的密钥,才可以。(http://blogs.msdn.com/b/vijaysk/archive/2009/03/14/caution-while-xcopying-iis-7-0-config-files.aspx

 

There was an error while performing this operation.

Details: Bad Data. (Exception from HRESULT: 0x80090005)

详细信息:错误的数据。(异常来自HRESULT:0x80090005)

or the encryption it uses machine specific keys in the iisConfiguration and iisWasKey containers. When the applicationHost.config is moved to a different server IIS can no longer decrypt the settings.

To get this working you can export and import the keys from the original server.

Export using the following commands

IIS使用了加密密钥,当applicationHost.config移到不同的服务器时,由于密钥不同,IIS就没办法再解密了,解决的办法是从原始服务器上备份密钥,再在这台服务器上还原,备份方法:

aspnet_regiis(这个程序一般在.NET的安装目录下,自己用DIR命令查看一下)

aspnet_regiis -px "iisConfigurationKey" "D:\iisConfigurationKey.xml" -pri 
aspnet_regiis -px "iisWasKey" "D:\iisWasKey.xml" -pri

接着把两个文件拷到B服务器上,再导入,导入的命令参数为:

aspnet_regiis -pi "iisConfigurationKey" "D:\iisConfigurationKey.xml" 
aspnet_regiis -pi "iisWasKey" "D:\iisWasKey.xml"

一般就可以合用了!

 另附IIS7备份的批处理文件:

c: 
@echo off
:loop
cls
set /p input=请选择:1为备份  2为恢复:
if %input%==1 (
RD /s /q d:\IIS7备份\备份
cd %windir%\System32\inetsrv\
Appcmd.exe
appcmd add backup "备份"
Xcopy %windir%\System32\inetsrv\backup /s d:\IIS7备份
RD /s /q %windir%\System32\inetsrv\backup\备份
pause 
exit
)
if %input%==2 (
Xcopy d:\IIS7备份 /s C:\Windows\System32\inetsrv\backup
cd C:\Windows\System32\inetsrv\
Appcmd.exe
appcmd restore backup "备份"
RD /s /q C:\Windows\System32\inetsrv\backup\备份
exit
)
goto loop


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值