Company: Link Business Solutions
Case No: T14209
Logged By: Irfaz Ahmad (Link Fiji) on behalf of Pacific Fishing Company Limited on 25 Mar 2024 03:50PM
Priority: High
Product: LinkSOFT
Group: Support
Time Taken (hrs): 11.00
Assigned To: Irfaz Ahmad (Link Fiji)
Circulation: Irfaz Ahmad, Pacific Fishing Company Limited, Sanjay
Resolve By: Tuesday, 16 April 2024 01:18 PM [23 days since logged date]
Status: Open
Subject: Error in upgrading DB - Error: Duplicate User in table
Summary:    

Bula Sanjay

I wanted to bring to your attention an issue encountered during the database upgrade process for PAFCO from version 9.33 to version 15.20.

Two errors were encountered during the upgrade:
  1. Duplicate UserID in table LT_SYS_UserCompany
  2. "Invalid column name 'Attachments'"

The first error states there is a duplicate UserID in table LT_SYS_UserCompany

The second error states "Invalid column name 'Attachments'"

Environment Details:

The database is being upgraded from DB Utilities on machine 10.0.0.18
Server: LINKQA4
Database Name: CLIENT-PAFCO-LinkSOFT

Requesting if you could you please review these errors.

Thank you for your attention to this matter.

Regards,
Irfaz Ahmad
Audit Notes:Edited by irfaz on 12/04/24 13:15. Edited by sanjay on 27/03/24 09:48. Edited by sanjay on 27/03/24 09:46. Edited by sanjay on 27/03/24 09:45. Edited by sanjay on 27/03/24 09:45. Edited by sanjay on 27/03/24 09:32. Edited by irfaz on 27/03/24 07:54. Edited by irfaz on 26/03/24 08:06. 
27 Mar 202409:23AM Comment 1 by Sanjay (Link Technologies) Assigned To: Irfaz Ahmad (Link Fiji) Followup Date: 28-03-2024 09:08 AM Time Taken (hrs): 4.00 Notes: Edited by sanjay on 27/03/24 09:40. ETC extended from: 25/03/2024 to 28/03/2024
Hi Irfaz, the error is coming from having the same username multiple times.

Solution: Identify which is the correct username and we can delete the ones that are incorrect.

Table 1  - Duplicate Usernames. Suggest deleting rows marked in RED

ApplicationNameUserNameCompanyIDEmployeeIDRateEnabled
ESS60121001699911
ESS60121001601211
ESS60121001902310
ESS60141001 01
ESS60141001601411
ESS90211001 11
ESS90211001245711
ESS90301001 11
ESS90301001251311
RECadmin1001NULLNULL1
ESSAdmin1001AdminNULL1
POSAdmin1001NULLNULL1
POSManager1001Manager11
RECManager1001NULLNULL0
ESSmanager1001NULLNULL1


27 Mar 202410:41AM Comment 2 by Sanjay (Link Technologies) Assigned To: Irfaz Ahmad (Link Fiji) Followup Date: 28-03-2024 09:48 AM Time Taken (hrs): 6.00

Hi Irfraz,

The issue with the Attachments is caused by a Custom Trigger on your datanase. I have placed a script below that will delete this trigger for you. 

SCRIPT 1 - Drop Custom Trigger before upgrading the database

IF  EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'LT_HR_LeaveNRoster_TRG'))

BEGIN

DROP TRIGGER LT_HR_LeaveNRoster_TRG

END


SCRIPT 2 - Delete Duplicate users before running the upgrade. Please confirm this with PAFCO before applying this script

DELETE FROM LT_SYS_UserCompany WHERE UserName IN ('6012') AND EmployeeID IN ('6999','9023')

DELETE FROM LT_SYS_UserCompany WHERE UserName IN ('6014') AND EmployeeID =''

DELETE FROM LT_SYS_UserCompany WHERE UserName IN ('9021') AND EmployeeID = ''

DELETE FROM LT_SYS_UserCompany WHERE UserName IN ('9030') AND EmployeeID = ''

DELETE FROM LT_SYS_UserCompany WHERE UserName IN ('admin') AND EmployeeID = 'admin'

DELETE FROM LT_SYS_UserCompany WHERE UserName IN ('Manager') AND EmployeeID = 'Manager'

DELETE FROM LT_SYS_UserCompany WHERE UserName IN ('Manager') AND Enabled = 0

See screenshot below. Let me know if you need further assistance.

Figure 1 - Upgrade from V9 to 15.2 resolving the "Duplicate User" issue


27 Mar 202410:43AM Comment 3 by Sanjay (Link Technologies) Assigned To: Irfaz Ahmad (Link Fiji) Followup Date: 28-03-2024 10:41 AM
Hi Irfaz, case T14209 updates wit the solution for PAFCO. There is a custom trigger that was causing the issue. I have upgraded the DB on QA4. Let me know if you need it restored so you can do he trial upgrade yourself.

12 Apr 202401:47PM Comment 4 by Irfaz Ahmad (Link Fiji) Assigned To: Irfaz Ahmad (Link Fiji) Followup Date: 16-04-2024 01:18 PM Time Taken (hrs): 1.00 Reference: Support Notes: ETC extended from: 28/03/2024 to 16/04/2024

Hi Sanjay,

The upgrade was completed successfully after applying those two scripts.

We have made a license request and request it be released to test PAFCO's customization.

Refer to server details:

Company Name: Pacific Fishing Company Ltd
Database Name: CLIENT-PAFCO-LinkSOFT
Server: LINKQA4
Hosted on: http://10.0.0.18/PAFCO-LinkSOFT-v15/





If you have any queries regarding this support incident, please call our support on Support: +679 222 0084. After Hours Support: +679 222 0085 or email Support@LinkTechnologies.com.fj and include the Case No: T14209 in the subject line of all emails regarding this issue.

Document size: 290.1 KB
For call complaints, please contact the Managing Director using this form.