Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Problem when upgrading from dnn 3.2.2Problem when upgrading from dnn 3.2.2
Previous
 
Next
New Post
1/16/2007 8:12 PM
 

this is the second DNN 3.2.2  that I have upgraded to 3.3.7 and in both occasions the process failed to upgrade to 3.2.3 with this diagnostic outcome:

System.Data.SqlClient.SqlException: There is already an object named 'PK_UserProfile' in the database.
Could not create constraint. See previous errors.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
   at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)


/* Add UserProfile Table */
/*************************/

IF NOT EXISTS (select * from dbo.sysobjects where id = object_id(N'dbo.[UserProfile]') and OBJECTPROPERTY(id, N'IsTable') = 1)
 BEGIN
  CREATE TABLE dbo.UserProfile
  (
   [ProfileID] int IDENTITY(1,1) NOT NULL,
   [UserID] int NOT NULL,
   [PropertyDefinitionID] int NOT NULL,
   [PropertyValue] nvarchar(3750) NULL,
   [PropertyText] ntext NULL,
   [Visibility] int NOT NULL DEFAULT 0,
   [LastUpdatedDate] datetime NOT NULL
  )

  ALTER TABLE dbo.UserProfile
   ADD CONSTRAINT [PK_UserProfile] PRIMARY KEY NONCLUSTERED ([ProfileID])

  ALTER TABLE dbo.UserProfile  WITH NOCHECK
   ADD CONSTRAINT [FK_UserProfile_Users] FOREIGN KEY([UserID]) REFERENCES dbo.[Users] ([UserID]) ON DELETE CASCADE

  ALTER TABLE dbo.UserProfile  WITH NOCHECK
   ADD CONSTRAINT [FK_UserProfile_ProfilePropertyDefinition] FOREIGN KEY([PropertyDefinitionID]) REFERENCES dbo.[ProfilePropertyDefinition] ([PropertyDefinitionID]) ON DELETE CASCADE

 END


System.Data.SqlClient.SqlException: ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_Files_Folders'. The conflict occurred in database 'DotNetNuke', table 'Folders', column 'FolderID'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
   at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)


ALTER TABLE dbo.Files ADD CONSTRAINT
 FK_Files_Folders FOREIGN KEY
 (
 FolderID
 ) REFERENCES dbo.Folders
 (
 FolderID
 )

 Even after this failure I am able to proceed normally. and the new release in record is 3.3.7

I am new at this and not a programmer, as anyone experienced this and is it risky to proceed.

any information will be greatly appreciated.

Franc
 

 
New Post
1/17/2007 3:57 AM
 

Franc,

the first issue might be due to a double statement, not checking properly for the existance of the constraint. You don't need to care.

The second issue is caused by existing file entries with folders references, where the folder entries are missing. Check the tables "Files" and "Folders" in your database and remove all unreferenced entries and go to DotNetNuke File Manager, check "recursive" and hit "syncronize". Afterwards go to Host :: SQL, enter

ALTER TABLE dbo.Files ADD CONSTRAINT
 FK_Files_Folders FOREIGN KEY
 (
 FolderID
 ) REFERENCES dbo.Folders
 (
 FolderID
 )

into the text box and execute the script.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
1/18/2007 7:03 AM
 

Thank you so much for your instructions, we where able to upgrade all of our DNN instances.

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Problem when upgrading from dnn 3.2.2Problem when upgrading from dnn 3.2.2


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out