AX 2012 ID Conflicts importing ModelStore

When importing model store using command on AX2012 management shell

Import-AXModelStore -File filename  – Server servername -Database DBname

We sometimes get a message that ID conflicts are there and hence the operation is aborted

Option -1

Use the following AXutil command instead which will give you the objects

axutil importstore /file:Filename /s:SQLservername /DB:targetDBName /verbose

this will give you list of objects with the conflicting IDs

 Option-2

Run the following SQL query and you will get list of the conflicting IDs

WITH DESTDATA AS

(SELECT DEST_ELEMENTTYPE.ElementTypeName,EXISTSINDEST.Name Pname,EXISTSINDEST.AXID PAXID,EXISTSINDEST.Origin Porigin,EXISTSINDEST.ElementType Pelementtype,EXISTSINDEST.ElementHandle PElementHandle,EXISTSINDEST.ParentHandle  PParentHandle,EXISTSINDEST.ParentID DestParentID

FROM [AX2012_Dest_Model].dbo.ModelElement AS EXISTSINDEST

INNER JOIN [AX2012_Dest_Model].dbo.ElementTypes AS DEST_ELEMENTTYPE

ON EXISTSINDEST.ElementType = DEST_ELEMENTTYPE.ElementType

WHERE EXISTSINDEST.Origin NOT IN (‘00000000-0000-0000-0000-000000000000’)

)

, SOURCEDATA AS

(SELECT

SOURCE_ELEMENTTYPE.ElementTypeName SElementTypeName,SOURCEMODEL.Name Sname,SOURCEMODEL.AXID SAXID,SOURCEMODEL.Origin Sorigin,SOURCEMODEL.ElementType Selementtype,SOURCEMODEL.ElementHandle SElementHandle,SOURCEMODEL.ParentHandle SParentHandle,SOURCEMODEL.ParentID SParentID

FROM [AX2012_Source_Model].dbo.ModelElement AS SOURCEMODEL

INNER JOIN [AX2012_Source_Model].dbo.ElementTypes AS SOURCE_ELEMENTTYPE

ON SOURCEMODEL.ElementType = SOURCE_ELEMENTTYPE.ElementType

WHERE SOURCEMODEL.Origin NOT IN (‘00000000-0000-0000-0000-000000000000’)

)

SELECT DESTDATA.ElementTypeName, DESTDATA.Pname Pname,DESTDATA.PAXID PAXID,DESTDATA.Porigin Porigin,Destdata.DestParentID DestParentID,DESTDATA.Pelementtype Pelementtype,SOURCEDATA.Sname  Sname,SOURCEDATA.SAXID  SAXID,SOURCEDATA.Sorigin sorigin,SOURCEDATA.SParentID SParentID

FROM DESTDATA INNER JOIN SOURCEDATA ON

SOURCEDATA.Selementtype              = DESTDATA.Pelementtype

AND SOURCEDATA.SAXID                != DESTDATA.PAXID

AND SOURCEDATA.Sorigin               = DESTDATA.Porigin

AND SOURCEDATA.SParentID             = DESTDATA.DestParentID

 

Leave a Reply

Your email address will not be published. Required fields are marked *