Mono Support Issue with db update script 4.7.40.3321 (Closed)

Viewed 41740 time(s), 14 post(s), 6/2/2014 12:23:36 PM - by Zoomicon
6/2/2014 12:23:36 PM
2793 Reputation 345 Total posts

upgrading from db 4.5.3103 and want to go to 4.7.40.4545

the first folder after 4.5.3016.35 (have higher version than that) is 4.7.40.3321, so I guess I need to run those SQL scripts first

in there, I see 00. Change calendar event.sql which throws error at

CREATE TABLE dbo.CalendarEventEntry

(

CalendarId uniqueidentifier NOT NULL,

CalendarEventId uniqueidentifier NOT NULL

) ON [PRIMARY]

Msg 207, Level 16, State 1, Line 40

Invalid column name 'CalendarId'.

this is logical since the table already exists and has the following fields: CalendarId, CalendarEventId, IsBusy (bit, not null)

- should I delete the old table (it's empty, although the CalendarEvent table has some entries, not sure what that extra table is for)?
</br>

- what about the "isBusy" column? the new script doesn't seem to create such column


</br>

</br>

1
6/2/2014 12:27:01 PM
2793 Reputation 345 Total posts

also what about the contraint DF_CalendarEventEntry_IsBusy that is related to the IsBusy field? Should I delete that too?

2
6/2/2014 12:31:14 PM
2793 Reputation 345 Total posts

decided to comment-out that CREATE TABLE and run the script and then it throws error at:

INSERT INTO CalendarEventEntry

([CalendarId]

,[CalendarEventId])

SELECT CalendarId, Id FROM CalendarEvent

Msg 207, Level 16, State 1, Line 42

Invalid column name 'CalendarId'.

</br>

</br>

I see the CalendarEvent has columns Id and OwnerCalendarId, but not CalendarId

3
6/2/2014 12:40:39 PM
2793 Reputation 345 Total posts

event when I changed CalendarId to OwnerCalendarId in that last issue, it complained later on that a primary key already existed at
</br>
</br>

ALTER TABLE dbo.CalendarEventEntry ADD CONSTRAINT

PK_CalendarEventEntry PRIMARY KEY CLUSTERED

(

CalendarId,

CalendarEventId

) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

4
6/2/2014 12:42:24 PM
2793 Reputation 345 Total posts

luckily the script uses transactions, so no damage was done from testing it (I hope)

I ended up renaming the old dbo.CalendarEventEntry to dbo._CalendarEventEntry and editing the script to write

INSERT INTO CalendarEventEntry

([CalendarId]

,[CalendarEventId])

SELECT OwnerCalendarId, Id FROM CalendarEvent

(it was saying SELECT CalendarId, Id there)
</br>
</br>and then it run fine (fingers crossed about the implications of that edit)

5
6/2/2014 12:54:38 PM
2793 Reputation 345 Total posts

oops, I also had to remove
</br>

ALTER TABLE dbo.CalendarEvent

DROP COLUMN CalendarId

for the transaction to execute (didn't notice that the "8 row(s) affected" wasn't shown - it was showing a green tick and a row of error info [because of the catch block you have there, maybe should remove it since it can confuse the user])

6
6/2/2014 1:05:15 PM
15993 Reputation 2214 Total posts

Hi,

yes you should run 3321, 3378, 3381, 3471, 3507, 3540, 3715, 3765, 3824, 3842 & 4545 in this particular order. I noticed that you got an error related to CalendarEventEntry in 3321 so we will test this against the 4.5.3016.35 and get back to you shortly.

After all did you manage to upgrade to the latest version or you are still on the 3321 ?

Regards

7
6/2/2014 1:55:04 PM
2793 Reputation 345 Total posts

the thing is that I was using db version, not monox version when looking at those folders

this can be very confusing since they use similar numbering pattern

now I did it using the monox version of my old site instead, hope this is the correct way

8
6/3/2014 12:32:23 PM
231 Reputation 38 Total posts

Hi Zoomicon,

Have you managed to upgrade it completely, or do you still have some issues?
If you are still encountering some issues, please send us detailed report.

Regards,
Darjan Bogdan

9
6/3/2014 4:54:42 PM
2793 Reputation 345 Total posts

yes, I had to go back to the backup db I had taken before starting the process then starting again

some readme.txt should exist in the SQL scripts folder to tell the user what to do and note there that those are monox versions they should compare against, not monox database versions

also, it would be nice if there was some automated process (say PowerShell to run those scripts [asking you what your monox version was and then finding folders and files needed to run automatically and running them, notifying you as it proceeds through each step)

10
1 2
This is a demo site for MonoX. Please visit Mono Software for more info.