web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Error occured during database import process from UAT to DEV Environment

(0) ShareShare
ReportReport
Posted on by 45

Hi,

I was trying to import the UAT Database to DEV, while Importing an unexpected error as occurred i.e., *** An unexpected failure occurred: Data plan execution failed with message One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Violation of PRIMARY KEY constraint 'PK__CLASSIDT__D9C1FA01463E3A33'. Cannot insert duplicate key in object 'dbo.CLASSIDTABLE'. The duplicate key value is (AADAuthenticationMonitoringAndDiagnostics).
The statement has been terminated.))). Needed a solution to this problem.

Quick response is appreciated, Thanks in advance.

 

  • MuthukumaranAX Profile Picture
    2,903 on at

    please confirm the following steps are performed

    learn.microsoft.com/.../dbmovement-scenario-exportuat

  • Sowmya170106@gmail.com Profile Picture
    45 on at

    Hi MuthuKumaranAX,

    Thank you for the response,

    Yes, All the steps are performed upto importing the database through executing  a code in command prompt i.e., SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200

    While this was processing it came across the error saying (*** An unexpected failure occurred: Data plan execution failed with message One or more errors occurred. (One or more errors occurred. (One or more errors occurred. (Violation of PRIMARY KEY constraint 'PK__CLASSIDT__D9C1FA01463E3A33'. Cannot insert duplicate key in object 'dbo.CLASSIDTABLE'. The duplicate key value is (AADAuthenticationMonitoringAndDiagnostics).

    The statement has been terminated.))). )

    Please find the below image of command prompt shows where the error has exactly occured.

    8831.MicrosoftTeams_2D00_image-_2800_3_2900_.png

  • MuthukumaranAX Profile Picture
    2,903 on at

    Instead of restoring to existing AXDB Database. please try the following approach

    1. stop the services

    2. Rename AXDB to "AXDb_Old"

    3. create new database and name it as AXDb

    4. then import the database

  • Dynamics365Admin Profile Picture
    212 on at

    Hi D365 User ,

    I am also facing he exact same issue. Were you able to import successfully ? If Yes, Could you please provide the steps you followed(after you encountered this error). Also, if there were any services needed to be stopped or any other things to be done.

    Your help will be much appreciated.

    Thanks and Regards.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

    Hi, This error is suggesting that Database is trying to import duplicate record in ClassIdTable table.

    I can see a record exist with Name AADAuthenticationMonitoringAndDiagnostics in ClassIdTable table.

    To replicate this issue, I tried to import record with same name in this table and sql gave same error. You can check if for any reason there is duplicate records with Name AADAuthenticationMonitoringAndDiagnostics in UAT (source) database.

    If not then take a backup of Dev (Target) Database, delete all records from this table and try to import the database.

    Duplicate-record1.png

  • Suggested answer
    Komi Siabi Profile Picture
    13,253 Most Valuable Professional on at

    Hello

    You might want to check this thread

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 265 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 215

#3
Subra Profile Picture

Subra 177 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans