Forums

Forums / Bugs & Issues / SQL Duplicate Key Error During Migration

SQL Duplicate Key Error During Migration

2 posts, 0 answered
  1. Frank Jahn
    Frank Jahn avatar
    9 posts
    Registered:
    22 Apr 2021
    22 Apr
    Link to this post
    Hello,
    I've encountered a persistent error while trying to import a migration that I hope you can help me with. Initially, when the error occurs, the "Details" button is replaced by an error message (see screenshot here: Error Screenshot)

    Error Description: The process fails due to a SQL exception related to duplicate key entries in the 'dbo.sf_permissions' table. Specifically, the error mentions a violation of the unique index 'idx_sf_permissions'. Here’s the gist of the error message:
    ____________________________________________________________________________________________________________________________________________________________________________________
     System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (89789e83-b98f-4e0d-8bf4-277f9476ecfc, 2cd67a28-a348-469b-b6b7-8615c683013c, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (89789e83-b98f-4e0d-8bf4-277f9476ecfc, e5ad8b68-bb70-4959-b8f1-018c85932ccf, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (89789e83-b98f-4e0d-8bf4-277f9476ecfc, d25b0a43-4863-47d3-9200-d19c4d9fd41c, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (d57a6bc3-3059-45aa-9f3b-6ada9717fb51, 2cd67a28-a348-469b-b6b7-8615c683013c, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (d57a6bc3-3059-45aa-9f3b-6ada9717fb51, e5ad8b68-bb70-4959-b8f1-018c85932ccf, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (d57a6bc3-3059-45aa-9f3b-6ada9717fb51, d25b0a43-4863-47d3-9200-d19c4d9fd41c, //, Controls).
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.
       at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows)
       at OpenAccessRuntime.Intellitrace.Update(String id, DbDataAdapter adapter, DataRow[] rows)
       at Telerik.OpenAccess.RT.sql.Batch.Perform(String connId, DbDataAdapter adapter, DataRow[] rows)
       at Telerik.OpenAccess.Runtime.Logging.LoggingDbCommand.ExecuteBatch(DbDataAdapter adapter, DataRow[] rows, Batch batch)
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.Execute(DbDataAdapter adapter, DataRow[] rows, Batch batch)
       --- End of inner exception stack trace ---
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.Execute(DbDataAdapter adapter, DataRow[] rows, Batch batch)
       at Telerik.OpenAccess.RT.sql.Batch.ExecuteBatchDataTable(Boolean withInfo)
    INSERT INTO [sf_permissions] ([id], [app_name], [deny], [grnt], [last_modified], [object_id], [principal_id], [set_name], [voa_version]) VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8)
    Batch Entry 0 (set event logging to all to see parameter data): Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (89789e83-b98f-4e0d-8bf4-277f9476ecfc, 2cd67a28-a348-469b-b6b7-8615c683013c, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (89789e83-b98f-4e0d-8bf4-277f9476ecfc, e5ad8b68-bb70-4959-b8f1-018c85932ccf, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (89789e83-b98f-4e0d-8bf4-277f9476ecfc, d25b0a43-4863-47d3-9200-d19c4d9fd41c, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (d57a6bc3-3059-45aa-9f3b-6ada9717fb51, 2cd67a28-a348-469b-b6b7-8615c683013c, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (d57a6bc3-3059-45aa-9f3b-6ada9717fb51, e5ad8b68-bb70-4959-b8f1-018c85932ccf, //, Controls).
    Cannot insert duplicate key row in object 'dbo.sf_permissions' with unique index 'idx_sf_permissions'. The duplicate key value is (d57a6bc3-3059-45aa-9f3b-6ada9717fb51, d25b0a43-4863-47d3-9200-d19c4d9fd41c, //, Controls).
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.
    The statement has been terminated.'>Details
    ____________________________________________________________________________________________________________________________________________________________________________________

    Has anyone else faced a similar issue or does anyone have additional suggestions on how to handle this?

    Thank you!
  2. Craig Furlonger
    Craig Furlonger avatar
    7 posts
    Registered:
    16 Jun 2023
    22 Apr in reply to Frank Jahn
    Link to this post
    Hello,

    I have just a couple of questions. Can you try migrating smaller loads? For instance on page at a time?

    Also when you migrate it gives you options to "Export Widget Templates, Export Resource Packages, Export Website Templates, Export Indirectly Related Pages, Export Permissions, Export Forms, and Export Media"

    Try with only
    Export Permissions,
    Export Forms,
    and Export Widget Templates.

    Maybe that will help.
2 posts, 0 answered