0

Attempting to update a server from 1.1.1 to 1.1.2 and the update fails during the database update phase. The error from the log is:

System.Exception: Can’t run SQL script C:Program Files (x86)SolidCP InstallerTmpsetupupdate_db.sql —> System.Exception: Error executing SQL command:
–SfB
IF  NOT EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N’[dbo].[SfBUserPlans]’) AND type in (N’U’))
BEGIN
CREATE TABLE [dbo].[SfBUserPlans](
[SfBUserPlanId] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[SfBUserPlanName] [nvarchar](300) NOT NULL,
[SfBUserPlanType] [int] NULL,
[IM] [bit] NOT NULL,
[Mobility] [bit] NOT NULL,
[MobilityEnableOutsideVoice] [bit] NOT NULL,
[Federation] [bit] NOT NULL,
[Conferencing] [bit] NOT NULL,
[EnterpriseVoice] [bit] NOT NULL,
[VoicePolicy] [int] NOT NULL,
[IsDefault] [bit] NOT NULL,
[RemoteUserAccess] [bit] NOT NULL DEFAULT 0,
[PublicIMConnectivity] [bit] NOT NULL  DEFAULT 0,
[AllowOrganizeMeetingsWithExternalAnonymous] [bit] NOT NULL DEFAULT 0,
[Telephony] [int] NULL,
[ServerURI] [nvarchar](300) NULL,
[ArchivePolicy] [nvarchar](300) NULL,
[TelephonyDialPlanPolicy] [nvarchar](300) NULL,
[TelephonyVoicePolicy] [nvarchar](300) NULL
CONSTRAINT [PK_SfBUserPlans] PRIMARY KEY CLUSTERED
(
[SfBUserPlanId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
End
IF  NOT EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N’[dbo].[SfBUsers]’) AND type in (N’U’))
BEGIN
CREATE TABLE [dbo].[SfBUsers](
[SfBUserID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int] NOT NULL,
[SfBUserPlanID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
[SipAddress] [nvarchar](300) NULL,
CONSTRAINT [PK_SfBUsers] PRIMARY KEY CLUSTERED
(
[SfBUserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
END

IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = ‘SfB’)
BEGIN
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (52, N’SfB’, 25, NULL, 1)
END
—> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint ‘PK_ResourceGroups’. Cannot insert duplicate key in object ‘dbo.ResourceGroups’. The duplicate key value is (52).

 

Any suggestions?