Uninstalling AF

Dec 28, 2012 at 11:36 AM
Edited Dec 28, 2012 at 11:58 AM

 

I uninstalled AF 502 from my test and tried to install it again.

No errors uninstalling and installing again.

But now the convert script displays error and does't finish

System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_activeforums_Groups'. Cannot insert duplicate key in object 'dbo.activeforums_Groups'. Violation of PRIMARY KEY constraint 'PK_activeforums_Forums'. Cannot insert duplicate key in object 'dbo.activeforums_Forums'. The statement has been terminated.

Is that normal behavior ?

Thanks

Dec 28, 2012 at 1:24 PM

Yes if you have yet the AF tables after uninstall. Try to unistalla AF. Be sure that tables are removed before reinstall AF.

 

Dec 28, 2012 at 1:26 PM
skiank wrote:

Yes if you have yet the AF tables after uninstall. Try to unistalla AF. Be sure that tables are removed before reinstall AF.

 

 

But i DID uninstall AF with no errors. Then install it again and run the script.

How can i be sure that the tables are uninstalled ? Isn't that supposed to be done when you uninstall a module ?

 

Dec 28, 2012 at 4:00 PM

Uninstall AF. then execute this script:

select * from sysobjects
where name like '%activeforums%'

Must return no records.

 

Dec 28, 2012 at 4:57 PM
skiank wrote:

Uninstall AF. then execute this script:

select * from sysobjects
where name like '%activeforums%'

Must return no records.

 

Uninstalling first and then running what you say, gives me 2 records

 

1. activeforums_DefaultGroupSettings

 

2. activeforums_DefaultForumSettings

So uninstalling the module doesn't wipe everything.

Dec 28, 2012 at 4:58 PM

Manually remove this tables before reinstalla AF:

DROP TABLE activeforums_DefaultGroupSettings
go
DROP TABLE activeforums_DefaultForumSettings

 

Dec 28, 2012 at 5:03 PM

 

I also see 4 tables

dbo.dnntoaf_groups

dbo.dnntoaf_forums

dbo.dnntoaf_replies

dbo.dnntoaf_topics

 

Dec 28, 2012 at 5:05 PM
skiank wrote:

Manually remove this tables before reinstalla AF:

DROP TABLE activeforums_DefaultGroupSettings
go
DROP TABLE activeforums_DefaultForumSettings

 

 

Msg 3705, Level 16, State 1, Line 1
Cannot use DROP TABLE with 'activeforums_DefaultGroupSettings' because 'activeforums_DefaultGroupSettings' is a procedure. Use DROP PROCEDURE.
Msg 3705, Level 16, State 1, Line 1
Cannot use DROP TABLE with 'activeforums_DefaultForumSettings' because 'activeforums_DefaultForumSettings' is a procedure. Use DROP PROCEDURE.

Dec 28, 2012 at 5:53 PM

Replace drop table with drop procedure in My script.

for the other 4 tables are used in Conversion script but are removed by the script. So you may ignore them

Dec 28, 2012 at 6:22 PM
Edited Dec 29, 2012 at 12:47 AM

 

Now the script gives me:

 

Msg 2627, Level 14, State 1, Line 52
Violation of PRIMARY KEY constraint 'PK_activeforums_Groups'. Cannot insert duplicate key in object 'dbo.activeforums_Groups'.
The statement has been terminated.
Msg 2627, Level 14, State 1, Line 96
Violation of PRIMARY KEY constraint 'PK_activeforums_Forums'. Cannot insert duplicate key in object 'dbo.activeforums_Forums'.
The statement has been terminated.
Msg 547, Level 16, State 0, Line 6
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_activeforums_ForumTopics_activeforums_Forums". The conflict occurred in database "discover_db", table "dbo.activeforums_Forums", column 'ForumId'.

 

Dec 29, 2012 at 3:20 PM

The problems may be two:

1) When you run scipt the table dbo.activeforums_Groups is not empty
2) Conversion script try to add a double record.

After reinstalling AF5 and befor to start conversion script try execute this two script and post here the result:

SELECT * FROM dbo.activeforums_Groups

AND

SELECT  GroupId, @TargetModuleId, Name, SortOrder, 1, 0, '','',-1 FROM dbo.

[Forum_Groups]

 

 

 

 

 
Dec 30, 2012 at 12:21 AM

 

In any case, i deleted everything, restored the backup and tried again all that.

Seems to work but didn't try to uninstall or anything.

Now it runs to a hidden page, since some problems need to be solved.

BUT edit/save solves everything so in my small forum it would not be hard to pass from all the posts and edit/save.

For an other one that a customer has, it can't be manually done.