|
|
|
|
Joined: 12/11/2006
Posts: 137
|
|
|
DotNetNuke.Services.Exceptions.ModuleLoadException: The DELETE statement conflicted with the REFERENCE constraint "FK_ModulePermission_Roles". The conflict occurred in database "MyDNN", table "dbo.ModulePermission", column 'RoleID'. The statement has been terminated. ---> System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_ModulePermission_Roles". The conflict occurred in database "MyDNN", table "dbo.ModulePermission", column 'RoleID'. The statement has been terminated. in System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) in System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) in System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) in System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) in System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) in System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) in System.Data.SqlClient.SqlCommand.ExecuteNonQuery() in PetaPoco.Database.Execute(String sql, Object[] args) in DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteNonQuery(String connectionString, CommandType type, Int32 timeout, String sql, Object[] args) in DotNetNuke.Data.SqlDataProvider.ExecuteNonQuery(String procedureName, Object[] commandParameters) in DotNetNuke.Data.DataProvider.DeletePortalInfo(Int32 PortalId) in DotNetNuke.Entities.Portals.PortalController.DeletePortalInternal(Int32 portalId) in DotNetNuke.Entities.Portals.PortalController.DeletePortal(PortalInfo portal, String serverPath) in DotNetNuke.Modules.Admin.Portals.Portals.OnGridDeleteCommand(Object source, GridCommandEventArgs e) --- Fine della traccia dello stack dell'eccezione interna ---
|
|
|
|
| |
|
|
|
which DNN version are you running?
|
|
|
|
| |
|
|
|
Joined: 12/11/2006
Posts: 137
|
|
|
07.04.02 (216)
Framework 4.0
|
|
|
|
| |
|
|
|
most likely, an upgrade for DNN 7.2.0 has not properly applied, which adds foreign keys and makes sure, permissions get updated and deleted properly. in this case, there is a delete of roles missing prior to deleting modules from pages. You would need to update the stored procedure DeletePortalInfo:
run the following code (excerpt from my Turbo Scripts) in Host > SQL:
IF EXISTS (SELECT * FROM sys.Procedures WHERE object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}DeletePortalInfo]')) DROP PROCEDURE {databaseOwner}[{objectQualifier}DeletePortalInfo] GO
CREATE PROCEDURE {databaseOwner}[{objectQualifier}DeletePortalInfo] @PortalID Int AS BEGIN UPDATE {databaseOwner}[{objectQualifier}Portals] SET RegisteredRoleID = Null, AdministratorRoleID = Null WHERE PortalId = @PortalID -- avoid circles when deleting roles DELETE FROM {databaseOwner}[{objectQualifier}CoreMessaging_Messages] WHERE PortalId = @PortalID -- Delete messages sent on this site DELETE FROM {databaseOwner}[{objectQualifier}ContentWorkflows] WHERE PortalId = @PortalID -- Delete workflows assigned to site DELETE FROM {databaseOwner}[{objectQualifier}ExtensionUrlProviderConfiguration] WHERE PortalId = @PortalID -- Delete url provider configurations for the site DELETE FROM {databaseOwner}[{objectQualifier}ExtensionUrlProviderSetting] WHERE PortalId = @PortalID -- Delete url provider settings for the site DELETE FROM {databaseOwner}[{objectQualifier}ExtensionUrlProviderTab] WHERE PortalId = @PortalID -- Delete url provider settings for pages in this site DELETE FROM {databaseOwner}[{objectQualifier}Journal] WHERE PortalId = @PortalID -- Delete journal entries for the site DELETE FROM {databaseOwner}[{objectQualifier}Journal_Access] WHERE PortalId = @PortalID -- Delete journal access settings DELETE FROM {databaseOwner}[{objectQualifier}Journal_TypeFilters] WHERE PortalId = @PortalID -- Delete journal filters DELETE FROM {databaseOwner}[{objectQualifier}Lists] WHERE PortalId = @PortalID -- Delete all the site lists and entries DELETE FROM {databaseOwner}[{objectQualifier}Folders] WHERE PortalId = @PortalID -- Delete all the site folders DELETE FROM {databaseOwner}[{objectQualifier}Modules] WHERE PortalId = @PortalID -- Delete all the site modules DELETE FROM {databaseOwner}[{objectQualifier}Packages] WHERE PortalId = @PortalID -- Delete all the site skins DELETE FROM {databaseOwner}[{objectQualifier}SynonymsGroups] WHERE PortalId = @PortalID -- Delete synonym groups for search in the site DELETE FROM {databaseOwner}[{objectQualifier}Workflow] WHERE PortalId = @PortalID -- Delete Workflows for this site
DELETE FROM {databaseOwner}[{objectQualifier}Portals] WHERE PortalId = @PortalID -- Finally: delete the site itself END -- PROCEDURE GO
|
|
|
|
| |
|
|
|
Joined: 12/11/2006
Posts: 137
|
|
|
I have copy-pasted the script in the Host -> SQL and ran it.
I got the message that the query was executed succesfully but... when I tried deleting the portal I got a slightly different Error involving a timeout expiration.
DotNetNuke.Services.Exceptions.ModuleLoadException: Timeout. Il tempo disponibile è scaduto prima del completamento dell'operazione o il server non risponde. ---> System.Data.SqlClient.SqlException: Timeout. Il tempo disponibile è scaduto prima del completamento dell'operazione o il server non risponde. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- Fine della traccia dello stack dell'eccezione interna --- in System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) in System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) in System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync() in System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket() in System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer() in System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value) in System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) in System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) in System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) in System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) in System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) in System.Data.SqlClient.SqlCommand.ExecuteNonQuery() in PetaPoco.Database.Execute(String sql, Object[] args) in DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteNonQuery(String connectionString, CommandType type, Int32 timeout, String sql, Object[] args) in DotNetNuke.Data.SqlDataProvider.ExecuteNonQuery(String procedureName, Object[] commandParameters) in DotNetNuke.Data.DataProvider.DeletePortalInfo(Int32 PortalId) in DotNetNuke.Entities.Portals.PortalController.DeletePortalInternal(Int32 portalId) in DotNetNuke.Entities.Portals.PortalController.DeletePortal(PortalInfo portal, String serverPath) in DotNetNuke.Modules.Admin.Portals.Portals.OnGridDeleteCommand(Object source, GridCommandEventArgs e) --- Fine della traccia dello stack dell'eccezione interna ---
|
|
|
|
| |