Error while Restoring DB After Dynamics F&O Version Upgrade "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 'I_15464SETTINGKEYINDEX'. Cannot insert duplicate key in object 'dbo.FINANCIALREPORTINGSETTINGS'. The duplicate key value is (5637144576, DisableMaps). The statement has been terminated.)))."
Dear Dev Team, We usually encounter this type of error after upgrading Dynamics versions. The simplest and most reliable way to resolve it is to restore or import the database using a temporary name , and then rename it back to AxDB afterward. Failed Execution : you will get the error message. "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 'I_15464SETTINGKEYINDEX'. Cannot insert duplicate key in object 'dbo.FINANCIALREPORTINGSETTINGS'. The duplicate key value is (5637144576, DisableMaps). The statement has been terminated.)))." Correct approach The key step is to temporarily rename AxDB to AxDBLocal during the import. C:\SqlPackageExe>SqlPackage.exe /a:import /sf:C:\DB\qfz-erp-stgbackup.bacpac /tsn:LOCALHOST /tdn:AxDBLocal /p:CommandTimeout=18000 /TargetEncryptConnection:False Later use below script to ...