Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Can't delete portalCan't delete portal
Previous
 
Next
New Post
10/20/2016 12:29 PM
 
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 ---
 
New Post
10/20/2016 5:35 PM
 
which DNN version are you running?

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
10/21/2016 3:47 AM
 
07.04.02 (216)

Framework 4.0

 
New Post
10/21/2016 4:35 AM
 
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

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
10/21/2016 5:34 AM
 

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 ---

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Can't delete portalCan't delete portal


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out