2010-09-24 61 views
0

我目前使用MSDeploy將一組網站從II6遷移到另一臺運行IIS7.5的機器。實際的網站遷移按預期工作,但我也試圖爲每個網站遷移相關數據庫。MSDeploy dbFullSql提供程序創建一個包的工作,但部署失敗

到目前爲止,我能夠成功地移動一組我們的測試網站,但我正在逐漸部署失敗(和EXTREMELY長期運行時間 - 1小時,一個400MB DB +)對我們的生活場所。我看到的失敗似乎與一些存儲在sql數據庫(作爲數據)的javascript有關。它看起來像當SMO BatchParser在SQL腳本讀取它產生它死在試圖插入行與數據一些JavaScript的第一行。

這裏是我使用的MSDeploy命令:

msdeploy.exe -source:source-manifest.xml -dest:manifest=dest-manifest.xml 

source-manifest.xml: 
<sitemanifest> 
    <dbFullSql path="Data Source=srv_source;Initial Catalog=db;User ID=usr;Password=pwd" Transacted="True" CopyAllLogins="False" CopyAllUsers="False" /> 
</sitemanifest> 

dest-manifest.xml: 
<sitemanifest> 
    <dbFullSql path="Data Source=srv_dest;Initial Catalog=db;Integrated Security=true" DropDestinationDatabase="True" /> 
</sitemanifest> 

MSDeploy錯誤是:

Error: An error occurred during execution of the database script. The approximate location of the error was between lines '17009' and '17400' of the script. The verbose log may have more information about the error. The command started with: 
INSERT [dbo].[Pages] ([PathID], [PageID], [PageKey 

Error: 
Error count: 1. 

SQL文件,導致該錯誤的摘錄:

INSERT [dbo].[Pages] ([PathID], [PageID], [PageKey], [DeveloperID], [FrameworkID], [MasterPageID], [FormID], [Label], [Description], [Status], [AdminPosition], [AdminIndent], [Created], [LastEdited], [PageScript], [PageScriptHead], [PageScriptForm], [PageOnLoad], [PageOnUnload], [PageOnSubmit], [HtmlAttributes], [HasThumbnail], [QueryStringVars], [FriendlyPageURL], [CanonicalURL], [MvtStatus], [MvtAutoOptimize], [MvtStartDate], [MvtEndDate], [MvtExperimentID], [DeepLinkOk]) VALUES (72, 580, N'zz', N'zz', N'zzz', N'zzz', NULL, N'zzz', N'zzz', N'U', 0, 0, CAST(0x00009D3D00A0C296 AS DateTime), CAST(0x00009D4C00C99FA8 AS DateTime), NULL, N' <script language="javascript" type="text/javascript"> 
function javascript_stuff() 
{ 
    this.$("panel").style.display = "block"; 
    ... 
lots more snipped out code in here 
} 

var regex = /^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/; 

var jsobj = new jsobj(); 
</script>', NULL, NULL, NULL, NULL, NULL, 1, NULL, N'welcome', NULL, N'N', N'N', NULL, NULL, 0, 0) 
GO 

另外,如果我嘗試通過IIS UI錯誤導入的包:

An error occurred during execution of the database script. The approximate location of the error was between lines '17003' and '17394' of the script. The verbose log may have more information about the error. The command started with : 
INSERT [dbo].[Pages] ([PathID], [PageID], [PageKey 

[Expanded Information] 
Microsoft.Web.Deployment.DeploymentException: An error occurred during execution of the database script. The approximate location of the error was between lines '17003' and '17394' of the script. The verbose log may have more information about the error. The command started with : 
INSERT [dbo].[Pages] ([PathID], [PageID], [PageKey 
---> ManagedBatchParser.ParserException 
at ManagedBatchParser.Parser.Parse() 
at Microsoft.Web.Deployment.SqlBatchParser.ProcessSqlCmdScript(String sqlCmdScript) 
at Microsoft.Web.Deployment.SqlScriptToDBProvider.AddHelper(DeploymentObject source, Boolean whatIf) 
--- End of inner exception stack trace --- 
at Microsoft.Web.Deployment.SqlScriptToDBProvider.AddHelper(DeploymentObject source, Boolean whatIf) 
at Microsoft.Web.Deployment.DeploymentObject.AddChild(DeploymentObject source, Int32 position, DeploymentSyncContext syncContext) 
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAddChild(DeploymentObject destParent, DeploymentObject sourceObject, Int32 position) 
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source) 
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source) 
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject) 
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable) 
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions) 
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentWellKnownProvider provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions) 
at Microsoft.Web.Deployment.UI.InstallProgressWizardPage.OnWorkerDoWork(Object sender, DoWorkEventArgs e) 
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument) 

任何人有任何的想法是,我怎麼能解決這個問題?如果我直接使用SQL Management Studio從包中運行sql文件,它運行得非常好。所以除非在SMO BatchParser的錯誤,必須有某種SMO選項我可以設置來解決這個問題。

任何幫助將不勝感激!

+0

經過進一步調查,似乎問題是在行數據(存儲的JavaScript代碼)中找到$(blah)。 MSDeploy允許在使用相同的$()語法SQL腳本SQLCMD風格變量替換。所以現在我知道爲什麼,但真正的問題是:有沒有辦法在MSDeploy中的dbFullSql提供程序中關閉變量替換? – 2010-09-25 02:49:20

回答

0

Web部署團隊在這裏,我們正在考慮這個問題。敬請關注!

編輯:這絕對是在網絡部署中的錯誤,在我們TSData腳本解析。如果腳本包含任何以$開頭的語句,我們將其視爲sqlcmd指令。我沒有解決方法 - 我們正在嘗試查看如何在v2中修復此問題。

+0

太好了,謝謝! – 2010-09-30 17:23:31

+0

對此有何更新? – 2010-10-14 15:07:51

相關問題