1

I'm creating a script for AX deployment from one instance to another (stage to test instance). I would want to synchronize the database using just a powershell command.

Does anyone know how to synchronize the database using just a powershell command or AX management utility command?

Thanks

michiboi
  • 65
  • 1
  • 8

1 Answers1

5

An extract from the F.A.Q. for Dynamics AX blog:

$axProcess = Start-Process -PassThru ($axClientPath + "`\Ax32.exe") -ArgumentList ($params + " -StartupCmd=Synchronize")
if ($axProcess.WaitForExit($AXSYNCTIMEOUT) -eq $false)
{
    Throw ("Error: Synchronize did not complete within " + $AXSYNCTIMEOUT / 60000 + " minutes")
}
10p
  • 5,488
  • 22
  • 30
  • Thanks for responding, I've read that but I was hoping for a simpler approach. is there any other way? :-) – michiboi Oct 20 '14 at 18:52
  • Does anyone know where to find the sync logs using this script? – Dieter Aug 20 '15 at 07:35
  • Simpler option: `Synchronize-AXDatabase` (though still does the above in the background): https://community.dynamics.com/ax/b/goshoom/archive/2011/12/13/dynamicsaxcommunity-powershell-module-introduction. Related module has since been migrated to GitHub: https://github.com/jorisdg/dynamicsaxadmin – JohnLBevan Dec 06 '17 at 17:27
  • Regarding Log files, the default location is `C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Log`; amend this path as appropriate for your instance (see Tommy Skaue's answer here: https://community.dynamics.com/ax/f/33/t/161960) – JohnLBevan Dec 06 '17 at 17:38