Database Synchronization using Command Prompt/PowerShell D365FO

 Instead of doing the sync through Visual Studio every time, we can directly run the below script in Command prompt or Power shell.

Only change we need to do in below script before execution is to provide password which is available in LCS against our environment.


Script - 

K:\AosService\WebRoot\bin\Microsoft.Dynamics.AX.Deployment.Setup.exe -bindir "K:\AosService\PackagesLocalDirectory" -metadatadir " K:\AosService\PackagesLocalDirectory" -sqluser "axdbadmin" -sqlserver "." -sqldatabase "AxDB" -setupmode "sync" -syncmode "fullall" -isazuresql "false" -sqlpwd "put your password here"


Navigation to get the password from LCS - 

1. Go to LCS(https://lcs.dynamics.com/v2) 

2. Go to your Environment and get the full details

3. Scroll down where you can see local accounts(username and password of your dev) and scroll to the right and you will see domain accounts

4. Copy the password against username 'axdbadmin'

That's it. Use that password in the script and execute it

Example -

K:\AosService\WebRoot\bin\Microsoft.Dynamics.AX.Deployment.Setup.exe -bindir "K:\AosService\PackagesLocalDirectory" -metadatadir " K:\AosService\PackagesLocalDirectory" -sqluser "axdbadmin" -sqlserver "." -sqldatabase "AxDB" -setupmode "sync" -syncmode "fullall" -isazuresql "false" -sqlpwd "PutPasswordHere@123"



Let us know if it works. Help others :)

Post a Comment

0 Comments

Contact Form