I tried again and here is the exact error along with a screen shot.
I am going to have to restore again.
Hopefully this tells you something.
25% ERROR occured - System.Data.SqlClient.SqlException (0x80131904): Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
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.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, 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 DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
ClientConnectionId:342b9355-cdda-4f89-97ff-83cedbe4f1a7
-- make sure we don't have any duplicate amail addresses on portals where Registration_UseEmailAsUserName is turned on
-- if so we need to turn off the feature here
DECLARE @PortalId int
DECLARE @DupCount int
DECLARE Portals_Cursor CURSOR FOR
Select PortalId from dbo.[PortalSettings] Where SettingName = 'Registration_UseEmailAsUserName' and SettingValue = 'true'
OPEN Portals_Cursor
FETCH NEXT FROM Portals_Cursor
INTO @PortalId
WHILE @@FETCH_STATUS = 0
BEGIN
set @DupCount = ISNULL((SELECT COUNT(*) TotalCount FROM dbo.[Users] U Inner Join dbo.[UserPortals] UP on UP.[UserId] = U.[UserId] WHERE UP.PortalId = @PortalId GROUP BY U.[Email] HAVING COUNT(*) > 1), 0)
if(@DupCount > 0)
BEGIN
Update dbo.[PortalSettings] set SettingValue = 'false' where SettingName = 'Registration_UseEmailAsUserName' and PortalID = @PortalId
END
FETCH NEXT FROM Portals_Cursor
INTO @PortalId
END
CLOSE Portals_Cursor;
DEALLOCATE Portals_Cursor;
/********************************************************
* Table: PortalSettings (allow CultureCode Null, DNN-5743)
********************************************************/
--Drop Foreign Key
IF EXISTS (
SELECT *
FROM Sys.Foreign_Keys
WHERE object_id = OBJECT_ID(N'dbo.[PortalSettings]')
AND name = N'FK_PortalSettings_Portals')
BEGIN
ALTER TABLE dbo.PortalSettings
DROP CONSTRAINT FK_PortalSettings_Portals
END