d365collaborative / d365fo.tools

Tools used for Dynamics 365 Finance and Operations
MIT License
246 stars 101 forks source link

Import-D365Bacpac -ImportTier1 Throwing The login already has an account under a different user name. #601

Closed HPLund closed 2 years ago

HPLund commented 2 years ago

Checked ax_db and dbo is mapped to sa (not axdbadmin). The Imported Database had axdbadmin as Login name for dbo,

Verified in SSMS by running CREATE USER [axdbadmin] FOR LOGIN [axdbadmin] WITH DEFAULT_SCHEMA=[dbo]

Mitigation ALTER AUTHORIZATION ON database::x TO sa CREATE USER [axdbadmin] FOR LOGIN [axdbadmin] WITH DEFAULT_SCHEMA=[dbo]

Don't know when this step is performed and hence have no control over the integrity of the imported Database (issue).

Will run it again with -Verbose Output as a new Database

Splaxi commented 2 years ago

Hi @HPLund

Could you share a bit more details?

Normally we recommend to import the bacpac into a "new" database, and after the import is completed, we utilize the swithc-d365database cmdlet.

If you could share where the database is coming from, and include som details about the version (D365FO) and stuff like that - we might be able to nail this together.

HPLund commented 2 years ago

Imported as a new Database. The same happened the second time (also as a new Database) – I have the Verbose log, but cannot share it as is. Bacpac source was a Tier 3 Sandbox which got a db-refresh from PROD November 1st.

I will perform the manual fix and switch database later this week. The reference to ax_db was only to show the difference in the dbo mapping from the default to the Database imported through D365fo.tools (and the only difference that can explain the Error raised which is correct).

D365fo.tools installed yesterday (vm restarted).

Hans-Petter Lund DCE, Technical Architect, CGI Norway

From: Mötz Jensen @.> Sent: torsdag 4. november 2021 10.13 To: d365collaborative/d365fo.tools @.> Cc: Lund, Hans-Petter @.>; Mention @.> Subject: Re: [d365collaborative/d365fo.tools] Import-D365Bacpac -ImportTier1 Throwing The login already has an account under a different user name. (Issue #601)

EXTERNAL SENDER: Do not click any links or open any attachments unless you trust the sender and know the content is safe. EXPÉDITEUR EXTERNE: Ne cliquez sur aucun lien et n’ouvrez aucune pièce jointe à moins qu’ils ne proviennent d’un expéditeur fiable, ou que vous ayez l'assurance que le contenu provient d'une source sûre.

Hi @HPLundhttps://urldefense.com/v3/__https:/github.com/HPLund__;!!AaIhyw!_ZURZ7yJgOFGGqvGeIz9yPIag2gYkF7EZP9L0S7GMc6uf40p2lzy0qDimLmFU8oDdOc$

Could you share a bit more details?

Normally we recommend to import the bacpac into a "new" database, and after the import is completed, we utilize the swithc-d365database cmdlet.

If you could share where the database is coming from, and include som details about the version (D365FO) and stuff like that - we might be able to nail this together.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/d365collaborative/d365fo.tools/issues/601*issuecomment-960576452__;Iw!!AaIhyw!_ZURZ7yJgOFGGqvGeIz9yPIag2gYkF7EZP9L0S7GMc6uf40p2lzy0qDimLmFGL19z8M$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKWJU5TR3PMTZMPO2CEFK2DUKJFCJANCNFSM5HI5PQXQ__;!!AaIhyw!_ZURZ7yJgOFGGqvGeIz9yPIag2gYkF7EZP9L0S7GMc6uf40p2lzy0qDimLmFMWbNdgY$. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https:/apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!AaIhyw!_ZURZ7yJgOFGGqvGeIz9yPIag2gYkF7EZP9L0S7GMc6uf40p2lzy0qDimLmFrlWKVlg$ or Androidhttps://urldefense.com/v3/__https:/play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!AaIhyw!_ZURZ7yJgOFGGqvGeIz9yPIag2gYkF7EZP9L0S7GMc6uf40p2lzy0qDimLmFjioo8DQ$.

Splaxi commented 2 years ago

I believe we should do some private chat, to learn more about what you did and didn't do 😉

Ping me on yammer and we can exchange contact details and take it by mail / teams.

Splaxi commented 2 years ago

I just hit the same issue with one of my customers.

I'll update the tools and release a new version, so we can help other people out. Thanks for providing the solution:

ALTER AUTHORIZATION ON database::AxDB TO sa
HPLund commented 2 years ago

Just tested importing the same bacpac now after updating the Tools and it works like expected. Issue solved.

Hans-Petter Lund DCE, Technical Architect, CGI Norway

From: Mötz Jensen @.> Sent: tirsdag 16. november 2021 13.38 To: d365collaborative/d365fo.tools @.> Cc: Lund, Hans-Petter @.>; Mention @.> Subject: Re: [d365collaborative/d365fo.tools] Import-D365Bacpac -ImportTier1 Throwing The login already has an account under a different user name. (Issue #601)

EXTERNAL SENDER: Do not click any links or open any attachments unless you trust the sender and know the content is safe. EXPÉDITEUR EXTERNE: Ne cliquez sur aucun lien et n’ouvrez aucune pièce jointe à moins qu’ils ne proviennent d’un expéditeur fiable, ou que vous ayez l'assurance que le contenu provient d'une source sûre.

I just hit the same issue with one of my customers.

I'll update the tools and release a new version, so we can help other people out. Thanks for providing the solution:

ALTER AUTHORIZATION ON database::AxDB TO sa

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/d365collaborative/d365fo.tools/issues/601*issuecomment-970231790__;Iw!!AaIhyw!4t3N_YLBxQSXHHHBHyNsWyVlTZk_892byk6CIpyMM4E7w26M2WRlfqNMYAkmMDKzbw8$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKWJU5UZHJF46HKXILQMZ4TUMJGB7ANCNFSM5HI5PQXQ__;!!AaIhyw!4t3N_YLBxQSXHHHBHyNsWyVlTZk_892byk6CIpyMM4E7w26M2WRlfqNMYAkmvAbzIdI$. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https:/apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!AaIhyw!4t3N_YLBxQSXHHHBHyNsWyVlTZk_892byk6CIpyMM4E7w26M2WRlfqNMYAkmhBbITRI$ or Androidhttps://urldefense.com/v3/__https:/play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!AaIhyw!4t3N_YLBxQSXHHHBHyNsWyVlTZk_892byk6CIpyMM4E7w26M2WRlfqNMYAkm0tEp4vk$.