Skip to main content
Solved

Restore snapshot: Violation of PRIMARY KEY constraint 'Note_PK'.


I have created a snapshot without attachments and wiki and exported it to XML from a production instance. When I attempt to restore the snapshot to a different (test) instance, I get an error:

 - Violation of PRIMARY KEY constraint 'Note_PK'. Cannot insert duplicate key in object 'dbo.Note'.

 

When I do a search in the notes.xml file from the snapshot export, the id identified in the error message is

 

<row NoteText="" GraphType="PX.SM.EmailSendReceiveMaint" EntityType="PX.SM.EMailAccount" NoteID="e6ed61c5-0122-ec11-9b48-00224843cfc4" />

 

The test instance to which I am restoring already has a older version of the same data. How should I resolve this?

 

 

Best answer by sweta68

Hi @KMcGuire,

The error message indicates that the duplicate key value causing the violation, which corresponds to the NoteID column in the 'dbo.Note' table.

If the data in the snapshot is the correct and updated version, you can delete the conflicting record from the 'dbo.Note' table in the test instance.

 

β€œEnsure you have a backup of the test instance's data before performing any delete operations.”


Retry the snapshot restoration process to the test instance

Hope it helps!

Regards,

Sweta

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+10
  • Semi-Pro III
  • 229 replies
  • Answer
  • May 19, 2023

Hi @KMcGuire,

The error message indicates that the duplicate key value causing the violation, which corresponds to the NoteID column in the 'dbo.Note' table.

If the data in the snapshot is the correct and updated version, you can delete the conflicting record from the 'dbo.Note' table in the test instance.

 

β€œEnsure you have a backup of the test instance's data before performing any delete operations.”


Retry the snapshot restoration process to the test instance

Hope it helps!

Regards,

Sweta


Forum|alt.badge.img

@sweta68 I also encountered this error yesterday.  I successfully restored the snapshot after deleting the conflicting record.  I was able to delete it because I was restoring to an on-premise tenant for which I have access to the database.  Several related questions: how would I resolve this if encountered restoring in an Acumatica-hosted SaaS tenant for which I don’t have access to the database.  Is there a remedy other than submitted a support case to have the Acumatica Support team delete it?  What causes this situation, how can it be avoided?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings