olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2015-11-17T14:30:24Z
I'm trying to upgrade

Current version 1.9.5.5 (2011) to Latest version 2.2.2 and have followed the instructions at

https://github.com/YAFNET/YAFNET/wiki/Upgrade- (from-Version-1.9.5.5-or-above)

To the letter.

When I run the wizard it suggests it is installing rather than upgrading and comes up with procedure [yaf_prov_upgrade] already exists. I started dropping database objects but clearly it seems to be installing rather than updating. How should I best kick it in the right direction?

Obviously I do need to keep the existing data ...

Ta.
Sponsor
olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2015-11-17T14:46:14Z
Additional info: error is of type:

Server Error in '/' Application.

FILE:
mssql/install/providers/procedures.sql

ERROR:
There is already an object named 'yaf_prov_profile_getprofiles' in the database.


I note there are also update scripts but the application seems to think it needs to do an install rather than an upgrade.

How should I correct it?
olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2016-02-02T14:56:47Z
Anybody? Is this forum dead and I'd be better off having a play around myself or perhaps finding a more actively developed/ supported forum application (any recommendations?).
tha_watcha
2016-02-02T19:36:16Z
I have recreate your update scenario to see why in your case the installer thinks this is a new installation.

As workaround you could rename the folder install/mssql/upgrade to install/mssql/install, then the correct scripts would be executed.
UserPostedImage
olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2016-02-08T15:08:25Z
Gave that a whirl with the following result:


Server Error in '/' Application.

FILE:
mssql/install/tables.sql

ERROR:
'DF_yaf_MessageHistory_MessageHistoryID' is not a constraint.
Could not drop constraint. See previous errors.

STATEMENT:
exec('[dbo].[yaf_drop_defaultconstraint_oncolumn] yaf_MessageHistory, MessageHistoryID')
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: FILE:
mssql/install/tables.sql

ERROR:
'DF_yaf_MessageHistory_MessageHistoryID' is not a constraint.
Could not drop constraint. See previous errors.

STATEMENT:
exec('[dbo].[yaf_drop_defaultconstraint_oncolumn] yaf_MessageHistory, MessageHistoryID')

Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:



[Exception: FILE:
mssql/install/tables.sql

olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2016-02-08T16:02:50Z
I tried restoring the database from a backup again as well so the scenario was 'clean'. Same issue.

If the upgrade won't work maybe I can do an install and then migrate the key data - any guidance available? Not too complex?

Ta in advance.
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-02-10T04:29:49Z
Originally Posted by: olops 

Gave that a whirl with the following result:
ERROR:
'DF_yaf_MessageHistory_MessageHistoryID' is not a constraint.
Could not drop constraint. See previous errors.


Try to execute this by hand and show result.
SELECT
o1.name
FROM
sys.objects o1
INNER JOIN sys.columns c ON
o1.object_id = c.default_object_id
INNER JOIN sys.objects o2 ON
c.object_id = o2.object_id
WHERE
o2.name = 'yaf_MessageHistory' AND
c.name = 'MessageHistoryID'


olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2016-02-10T07:48:52Z
Result:

name
DF_yaf_MessageHistory_MessageHistoryID
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-02-10T12:57:59Z
Very good.
Run this now and show result
SELECT
o1.name, o1.type_desc
FROM
sys.objects o1
INNER JOIN sys.columns c ON
o1.object_id = c.default_object_id
INNER JOIN sys.objects o2 ON
c.object_id = o2.object_id
WHERE
o2.name = 'yaf_MessageHistory' AND
c.name = 'MessageHistoryID'
olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2016-02-10T13:32:48Z
name type_desc
DF_yaf_MessageHistory_MessageHistoryID DEFAULT_CONSTRAINT
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-02-10T14:09:52Z
This is definitely a constraint.
Execute this
SELECT
o1.name, o1.type_desc, o2.name as table_name
FROM
sys.objects o1
INNER JOIN sys.columns c ON
o1.object_id = c.default_object_id
INNER JOIN sys.objects o2 ON
c.object_id = o2.object_id
WHERE
o2.name = 'yaf_MessageHistory' AND
c.name = 'MessageHistoryID'
if table_name will be 'yaf_MessageHistory'
just drop the table and run installation again you barely need it filled and it will be recreated.
The table had MessageHistoryID column at some point, but later it was dropped and replaced by MessageID column.
SQL Server is rather imperfect in correct contsraints checking.
olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2016-02-10T16:54:10Z
Not much progress ... just on to the next error:


Server Error in '/' Application.

FILE:
mssql/install/tables.sql

ERROR:
'DF__yaf_Board__Board__36B12243' is not a constraint.
Could not drop constraint. See previous errors.

STATEMENT:
exec('[dbo].[yaf_drop_defaultconstraint_oncolumn] yaf_Board, BoardUID')
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: FILE:
mssql/install/tables.sql

ERROR:
'DF__yaf_Board__Board__36B12243' is not a constraint.
Could not drop constraint. See previous errors.

STATEMENT:
exec('[dbo].[yaf_drop_defaultconstraint_oncolumn] yaf_Board, BoardUID')

Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:



[Exception: FILE:
mssql/install/tables.sql

bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-02-11T01:03:30Z
Try this.
Make sure that you dont have BoardUID column in yaf_Board table, otherwise delete it.
Do you have it in your table?
Then execute 2 scripts one by one in the order. Show result of each just for reference, if any.
If you have BoardUID column you'd better execute the 2 scripts first, before the column deletion.
So we can be sure we don't have any ghost constraints.
EXEC sp_unbindefault 'yaf_Board.BoardUID'
DROP DEFAULT 'DF__yaf_Board__Board__36B12243'


olops
  •  olops
  • 57.8% (Neutral)
  • YAF Camper Topic Starter
2016-02-11T13:00:49Z
• BoardUID is there

• EXEC sp_unbindefault 'yaf_Board.BoardUID'

=> Msg 15148, Level 16, State 1, Procedure sp_unbindefault, Line 157
The data type or table column 'yaf_Board.BoardUID' does not exist or you do not have permission.
It does exist:

CREATE TABLE [hostinpro2241uk5167_SIRCForum].[yaf_Board](
[BoardID] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) NOT NULL,
[AllowThreaded] [bit] NOT NULL,
[MembershipAppName] [nvarchar](255) NULL,
[RolesAppName] [nvarchar](255) NULL,
[BoardUID] [uniqueidentifier] NULL DEFAULT (newid()),
CONSTRAINT [PK_yaf_Board] PRIMARY KEY CLUSTERED
(
[BoardID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]


DROP DEFAULT 'DF__yaf_Board__Board__36B12243'
=>
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near 'DF__yaf_Board__Board__36B12243'.
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2016-02-11T15:56:53Z
You need to delete BoardUID column.
The column should be deleted later in update scripts. I don't understand why it exists.
I don't have time to look into current yaf update scripts, but the simple solution should help.
I can say from problems type you have - there is something wrong with update logic,
If you will encounter similar problems further you should contact a YAF developer to fix the update logic in YAF source code.
Hopefully, you have made a back-up.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved