Hi.
I got a couple of errors when upgrading vom DNN 4.9.4 to 5.1.1.
(Windows Server 2003, SQL 2005 DB)
Here is my log (Executing Script: 05.00.00.SqlDataProvider Error! (see 05.00.00.log for more information)
Thanks in advance for your support!
------------
System.Data.SqlClient.SqlException: 'FK_PackageAssemblies_PackageAssemblies' is not a constraint.
Could not drop constraint. See previous errors.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
/************************************************************/
/***** SqlDataProvider *****/
/***** *****/
/***** *****/
/***** Note: To manually execute this script you must *****/
/***** perform a search and replace operation *****/
/***** for dbo. and *****/
/***** *****/
/************************************************************/
/* Fix Assemblies/Packages FK */
/********************************/
ALTER TABLE dbo.Assemblies
DROP CONSTRAINT FK_PackageAssemblies_PackageAssemblies
System.Data.SqlClient.SqlException: There is already an object named 'FK_PackageAssemblies_PackageAssemblies' in the database.
Could not create constraint. See previous errors.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
ALTER TABLE dbo.Assemblies
ADD CONSTRAINT FK_PackageAssemblies_PackageAssemblies FOREIGN KEY ( PackageID ) REFERENCES dbo.Packages ( PackageID ) ON UPDATE NO ACTION ON DELETE CASCADE
System.Data.SqlClient.SqlException: Column names in each table must be unique. Column name 'EditorControlSrc' in table 'dbo.PackageTypes' is specified more than once.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
/* Add EditorControlSrc Column to PackageTypes */
/***********************************************/
ALTER TABLE dbo.PackageTypes
ADD EditorControlSrc nvarchar(250) NULL
System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'IX_Permission'. Cannot insert duplicate key in object 'dbo.Permission'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
/* Add New DesktopModule Permission */
/************************************/
INSERT INTO dbo.Permission (
[PermissionCode],
[ModuleDefID],
[PermissionKey],
[PermissionName]
) VALUES (
'SYSTEM_DESKTOPMODULE',
-1,
'DEPLOY',
'Can Deploy'
)
System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'IX_ModuleControls'. Cannot insert duplicate key in object 'dbo.ModuleControls'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
/* Move User Accounts Module Definition to the Security DesktopModule */
/*********************************************************************/
DECLARE @DesktopModuleID int
SET @DesktopModuleID = (SELECT DesktopModuleID FROM dbo.DesktopModules WHERE ModuleName = 'Security')
DECLARE @ModuleDefID int
SET @ModuleDefID = (SELECT ModuleDefID FROM dbo.ModuleDefinitions WHERE FriendlyName = 'User Accounts')
UPDATE dbo.ModuleDefinitions
SET DesktopModuleID = @DesktopModuleID
WHERE ModuleDefID = @ModuleDefID
UPDATE dbo.ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Security/Users.ascx',
IconFile = '~/images/icon_users_32px.gif'
WHERE ControlSrc = 'Admin/Users/Users.ascx'
AND ModuleDefID = @ModuleDefID
UPDATE dbo.ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Security/ManageUsers.ascx',
IconFile = '~/images/icon_users_32px.gif'
WHERE ControlSrc = 'Admin/Users/ManageUsers.ascx'
AND ModuleDefID = @ModuleDefID
UPDATE dbo.ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Security/ProfileDefinitions.ascx',
IconFile = '~/images/icon_users_32px.gif'
WHERE ControlSrc = 'Admin/Users/ProfileDefinitions.ascx'
AND ModuleDefID = @ModuleDefID
UPDATE dbo.ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Security/EditProfileDefinition.ascx',
IconFile = '~/images/icon_users_32px.gif'
WHERE ControlSrc = 'Admin/Users/EditProfileDefinition.ascx'
AND ModuleDefID = @ModuleDefID
UPDATE dbo.ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Security/UserSettings.ascx'
WHERE ControlSrc = 'Admin/Users/UserSettings.ascx'
AND ModuleDefID = @ModuleDefID
INSERT INTO dbo.ModuleControls(
ModuleDefID,
ControlKey,
ControlTitle,
ControlSrc,
IconFile,
ControlType,
SupportsPartialRendering
)
VALUES (
@ModuleDefID,
'User Roles',
'User Roles',
'DesktopModules/Admin/Security/SecurityRoles.ascx',
'~/images/icon_securityroles_32px.gif',
1,
1
)
DELETE dbo.DesktopModules
WHERE ModuleName = 'User Accounts'
System.Data.SqlClient.SqlException: There is already an object named 'Tmp_Packages' in the database.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
/***********************************************************/
/* End Update Admin Modules to conform to Module Standards */
/***********************************************************/
/* Update Packages */
/*******************/
CREATE TABLE dbo.Tmp_Packages
(
PackageID int NOT NULL IDENTITY (1, 1),
PortalID int NULL,
Name nvarchar(50) NOT NULL,
FriendlyName nvarchar(250) NOT NULL,
[Description] nvarchar(2000) NULL,
PackageType nvarchar(50) NOT NULL,
[Version] nvarchar(50) NOT NULL,
License ntext NULL,
Manifest ntext NULL,
[Owner] nvarchar(100) NULL,
Organization nvarchar(100) NULL,
Url nvarchar(250) NULL,
Email nvarchar(100) NULL,
ReleaseNotes ntext NULL,
IsSystemPackage bit NOT NULL
)
ALTER TABLE dbo.Tmp_Packages ADD CONSTRAINT DF_Packages_IsSystemPackage DEFAULT 0 FOR IsSystemPackage
SET IDENTITY_INSERT dbo.Tmp_Packages ON
IF EXISTS(SELECT * FROM dbo.Packages)
EXEC('INSERT INTO dbo.Tmp_Packages (PackageID, Name, FriendlyName, Description, PackageType, Version, License, Manifest)
SELECT PackageID, Name, FriendlyName, Description, PackageType, Version, License, Manifest FROM dbo.Packages WITH (HOLDLOCK TABLOCKX)')
SET IDENTITY_INSERT dbo.Tmp_Packages OFF
ALTER TABLE dbo.Assemblies DROP CONSTRAINT FK_PackageAssemblies_PackageAssemblies
DROP TABLE dbo.Packages
EXECUTE sp_rename N'dbo.Tmp_Packages', N'Packages', 'OBJECT'
ALTER TABLE dbo.Packages ADD CONSTRAINT PK_Packages PRIMARY KEY CLUSTERED ( PackageID )
CREATE UNIQUE NONCLUSTERED INDEX IX_Packages ON Packages ( [Owner], Name, PortalID )
ALTER TABLE dbo.Assemblies ADD CONSTRAINT FK_PackageAssemblies_PackageAssemblies FOREIGN KEY ( PackageID ) REFERENCES dbo.Packages ( PackageID ) ON UPDATE NO ACTION ON DELETE NO ACTION
System.Data.SqlClient.SqlException: Invalid column name 'PortalID'.
Invalid column name 'ReleaseNotes'.
Invalid column name 'Owner'.
Invalid column name 'Organization'.
Invalid column name 'Url'.
Invalid column name 'Email'.
Invalid column name 'IsSystemPackage'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
CREATE PROCEDURE dbo.[AddPackage]
@PortalID int,
@Name nvarchar(50),
@FriendlyName nvarchar(250),
@Description nvarchar(2000),
@PackageType nvarchar(50),
@Version nvarchar(50),
@License ntext,
@Manifest ntext,
@Owner nvarchar(100),
@Organization nvarchar(100),
@Url nvarchar(250),
@Email nvarchar(100),
@ReleaseNotes ntext,
@IsSystemPackage bit
AS
INSERT INTO dbo.Packages
(
PortalID,
[Name],
FriendlyName,
[Description],
PackageType,
Version,
License,
Manifest,
ReleaseNotes,
[Owner],
Organization,
Url,
Email,
IsSystemPackage
)
VALUES (
@PortalID,
@Name,
@FriendlyName,
@Description,
@PackageType,
@Version,
@License,
@Manifest,
@ReleaseNotes,
@Owner,
@Organization,
@Url,
@Email,
@IsSystemPackage
)
SELECT SCOPE_IDENTITY()
System.Data.SqlClient.SqlException: There is already an object named 'GetSearchResultsByWord' in the database.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
CREATE PROCEDURE dbo.GetSearchResultsByWord
@PortalID int,
@Word nvarchar(100)
AS
SELECT si.SearchItemID,
sw.Word,
siw.Occurrences,
siw.Occurrences + 1000 AS Relevance,
m.ModuleID,
tm.TabID,
m.ModuleTitle AS Title,
si.Description,
si.Author,
si.PubDate,
si.SearchKey,
si.Guid,
si.ImageFileId,
u.FirstName + ' ' + u.LastName As AuthorName,
m.PortalId
FROM dbo.SearchWord sw
INNER JOIN dbo.SearchItemWord siw ON sw.SearchWordsID = siw.SearchWordsID
INNER JOIN dbo.SearchItem si ON siw.SearchItemID = si.SearchItemID
INNER JOIN dbo.Modules m ON si.ModuleId = m.ModuleID
LEFT OUTER JOIN dbo.TabModules tm ON si.ModuleId = tm.ModuleID
INNER JOIN dbo.Tabs t ON tm.TabID = t.TabID
LEFT OUTER JOIN dbo.Users u ON si.Author = u.UserID
WHERE (((m.StartDate Is Null) OR (GetDate() > m.StartDate)) AND ((m.EndDate Is Null) OR (GetDate() < m.EndDate)))
AND (((t.StartDate Is Null) OR (GetDate() > t.StartDate)) AND ((t.EndDate Is Null) OR (GetDate() < t.EndDate)))
AND (sw.Word = @Word)
AND (t.IsDeleted = 0)
AND (m.IsDeleted = 0)
AND (t.PortalID = @PortalID)
ORDER BY Relevance DESC