I'm on the latest 7.3.4 DNN Platform. I want to delete an empty portal, no modules and the recycle bin is also empty but I get this error:
DotNetNuke.Services.Exceptions.ModuleLoadException: The DELETE statement conflicted with the REFERENCE constraint "FK_BizModules_UPG_AlbumModule_Modules". The conflict occurred in database "dnn", table "dbo.BizModules_UPG_AlbumModule", column 'ModuleId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_ModulePermission_Roles". The conflict occurred in database "dnn", table "dbo.ModulePermission", column 'RoleID'.
The statement has been terminated.
The statement has been terminated. ---> System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_BizModules_UPG_AlbumModule_Modules". The conflict occurred in database "dnn", table "dbo.BizModules_UPG_AlbumModule", column 'ModuleId'.
The DELETE statement conflicted with the REFERENCE constraint "FK_ModulePermission_Roles". The conflict occurred in database "dnn", table "dbo.ModulePermission", column 'RoleID'.
The statement has been terminated.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at PetaPoco.Database.Execute(String sql, Object[] args)
at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteNonQuery(String connectionString, CommandType type, Int32 timeout, String sql, Object[] args)
at DotNetNuke.Data.SqlDataProvider.ExecuteNonQuery(String procedureName, Object[] commandParameters)
at DotNetNuke.Data.DataProvider.DeletePortalInfo(Int32 PortalId)
at DotNetNuke.Entities.Portals.PortalController.DeletePortalInternal(Int32 portalId)
at DotNetNuke.Entities.Portals.PortalController.DeletePortal(PortalInfo portal, String serverPath)
at DotNetNuke.Modules.Admin.Portals.Portals.OnGridDeleteCommand(Object source, GridCommandEventArgs e)
--- End of inner exception stack trace ---