BugNET

Open source issue tracking & project management

Forums

HomeHomeSupportSupportUpgrading BugNE...Upgrading BugNE...0.7.921.0 to 0.8.140.00.7.921.0 to 0.8.140.0
Previous
 
Next
New Post
12/11/2009 9:21 AM
 

I've restored and converted my SQL Server 2000 BugNET database into SQL Server 2005 and I'm attempting an upgrade.

It looks like I'll have to do some data analysis:

Error Details

File 0.8.140.0.SqlDataProvider.sql
Error The INSERT statement conflicted with the FOREIGN KEY constraint "FK_BugNet_Issues_BugNet_ProjectMilestones1". The conflict occurred in database "BugNET", table "dbo.BugNet_ProjectMilestones", column 'MilestoneId'.

 
New Post
12/14/2009 5:11 AM
 

Looks like some orphaned records that the milestoneid doesn't exist.


Davin Dubeau

follow us on twitter facebook users group google plus
 
New Post
12/14/2009 7:44 AM
 

Yes, that's exactly what it was. There was an an issue in the 'Bug' table that was using an invalid VersionID. A simple query identified the record which I was able to update with a known valid VersionID.

SELECT * FROM dbo.Bug WHERE VersionID NOT IN (SELECT VersionID FROM dbo.Version)

Now I'm on to looking at my next error:

Error Details

File 0.8.140.0.SqlDataProvider.sql
Error 'FK_ProjectMailBox_aspnet_Users' is not a constraint. Could not drop constraint. See previous errors.

 
New Post
12/14/2009 8:05 AM
 

In 0.8.140.0.SqlDataProvider.sql I commented out some DROP statements that were attempting to drop foreign key contstraints that didn't exist for my tables.

Once removed, the upgrade installation reported success.

 
New Post
1/6/2010 7:56 AM
 

This worked for me as well. looks like most of these constraints didn't exist in 7.921.0. Here is the revised section of the script that worked for me:

(all of the '-- ' are commented out of the script.

--Drop all old objects
-- ALTER TABLE [dbo].[ProjectMailBox] DROP CONSTRAINT [FK_ProjectMailBox_aspnet_Users]
-- ALTER TABLE [dbo].[ProjectMailBox] DROP CONSTRAINT [FK_ProjectMailBox_Project]
-- ALTER TABLE [dbo].[ProjectMailBox] DROP CONSTRAINT [FK_ProjectMailBox_Type]
ALTER TABLE [dbo].[RelatedBug] DROP CONSTRAINT [FK_RelatedBug_Bug]
ALTER TABLE [dbo].[ProjectCustomFieldSelection] DROP CONSTRAINT [FK_ProjectCustomFieldSelection_ProjectCustomFields]
ALTER TABLE [dbo].[ProjectCustomFieldValues] DROP CONSTRAINT [FK_ProjectCustomFieldValues_Bug]
-- ALTER TABLE [dbo].[ProjectCustomFieldValues] DROP CONSTRAINT [FK_ProjectCustomFieldValues_ProjectCustomFields]
-- ALTER TABLE [dbo].[UserProjects] DROP CONSTRAINT [FK_UserProjects_aspnet_Users]
-- ALTER TABLE [dbo].[UserProjects] DROP CONSTRAINT [FK_UserProjects_Project]
-- ALTER TABLE [dbo].[UserRoles] DROP CONSTRAINT [FK_UserRoles_aspnet_Users]
ALTER TABLE [dbo].[UserRoles] DROP CONSTRAINT [FK_UserRoles_Roles]
ALTER TABLE [dbo].[RolePermission] DROP CONSTRAINT [FK_RolePermission_Permission]
ALTER TABLE [dbo].[RolePermission] DROP CONSTRAINT [FK_RolePermission_Roles]
ALTER TABLE [dbo].[Roles] DROP CONSTRAINT [FK_Roles_Project]
-- ALTER TABLE [dbo].[BugHistory] DROP CONSTRAINT [FK_BugHistory_aspnet_Users]
ALTER TABLE [dbo].[BugHistory] DROP CONSTRAINT [FK_BugHistory_Bug]
-- ALTER TABLE [dbo].[BugComment] DROP CONSTRAINT [FK_BugComment_aspnet_Users]
ALTER TABLE [dbo].[BugComment] DROP CONSTRAINT [FK_BugComment_Bug]
-- ALTER TABLE [dbo].[BugTimeEntry] DROP CONSTRAINT [FK_BugTimeEntry_aspnet_Users]
ALTER TABLE [dbo].[BugTimeEntry] DROP CONSTRAINT [FK_BugTimeEntry_Bug]
-- ALTER TABLE [dbo].[BugNotification] DROP CONSTRAINT [FK_BugNotification_aspnet_Users]
ALTER TABLE [dbo].[BugNotification] DROP CONSTRAINT [FK_BugNotification_Bug]
-- ALTER TABLE [dbo].[Project] DROP CONSTRAINT [FK_Project_aspnet_Users]
-- ALTER TABLE [dbo].[Project] DROP CONSTRAINT [FK_Project_aspnet_Users1]
ALTER TABLE [dbo].[ProjectCustomFields] DROP CONSTRAINT [FK_ProjectCustomFields_Project]
ALTER TABLE [dbo].[ProjectCustomFields] DROP CONSTRAINT [FK_ProjectCustomFields_ProjectCustomFieldType]
-- ALTER TABLE [dbo].[BugAttachment] DROP CONSTRAINT [FK_BugAttachment_aspnet_Users]
ALTER TABLE [dbo].[BugAttachment] DROP CONSTRAINT [FK_BugAttachment_Bug]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_aspnet_Users]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_aspnet_Users1]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_aspnet_Users2]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_Component]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_FixedInVersionId]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_Priority]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_Project]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_ProjectID]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_Resolution]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_Status]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_Type]
-- ALTER TABLE [dbo].[Bug] DROP CONSTRAINT [FK_Bug_Version]
-- ALTER TABLE [dbo].[Component] DROP CONSTRAINT [FK_Component_Project]
-- ALTER TABLE [dbo].[Version] DROP CONSTRAINT [FK_Version_Project]

 
Previous
 
Next
HomeHomeSupportSupportUpgrading BugNE...Upgrading BugNE...0.7.921.0 to 0.8.140.00.7.921.0 to 0.8.140.0


Forum Policy

These Discussion Forums are dedicated to the discussion of the BugNET issue tracker.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:
1. No Advertising.
2. No Flaming or Trolling.
3. No Profanity, Racism, or Prejudice.
4. Site Moderators have the final word on approving/removing a thread or post or comment.
5. English language posting only, please.