After beating my head against the wall for hours I have of an undocumented and as far as I could find an unpublished of a limitation of the database sync engine in Microsoft Dynamics 365 LBD.
When certain special characters are used in passwords (even though its encrypted) the database sync will fail. The below characters I know do not work and should be avoided.
The Error message you will get when using these characters is
"initializationexception database login failed
please check SQL credentials:"
Other ways a database sync will get this error:
The encryption was done with the wrong certificate (including misconfigured certificates)
Incorrect passwords (use the decrypt PowerShell command if you need to see if the password is correct) and test it in SSMS then in a manual database sync (See below if you need to do a manual database sync).
Hidden special characters make sure if copy pasting passwords in any screen you first put it in Notepad before you paste into LCS.
Trigger a manual database sync in Local Business Data
There are 2 ways to trigger a database sync
- Truncate the SF.Synclog table then restart all application nodes (I suggest doing this when I do a database refresh to lower environments)
- Running the deployment.setup.exe (I suggest doing this while diagnosing database sync issues)
Just give me the cheat sheet
The D365FOLBDAdmin Module has this function in it along with more functions to administrate your Local Business data environment(s) and can be downloaded on the PowerShell Module Gallery or on my GitHub page (GNU GPLv3 license).
Using this function in combination of the Get-D365LBDConfig and valid SQL credentials you can trigger this easily.