Solved

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

  • 4 October 2022
  • 2 replies
  • 241 views

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?

 

 

icon

Best answer by sweta68 19 May 2023, 09:20

View original

2 replies

Userlevel 7
Badge +10

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

Userlevel 2
Badge

@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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved