web
You’re offline. This is a read only version of the page.
close
Skip to main content
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.

 

I have the same question (0)
  • MuthukumaranAX Profile Picture
    2,901 on at
    RE: Error occured during database import process from UAT to DEV Environment

    please confirm the following steps are performed

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

  • Sowmya170106@gmail.com Profile Picture
    45 on at
    RE: Error occured during database import process from UAT to DEV Environment

    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,901 on at
    RE: Error occured during database import process from UAT to DEV Environment

    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
    RE: Error occured during database import process from UAT to DEV Environment

    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,563 Moderator on at
    RE: Error occured during database import process from UAT to DEV Environment

    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,047 Most Valuable Professional on at
    RE: Error occured during database import process from UAT to DEV Environment

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,188

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 868 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 593 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans