Better restore and less dependencies for containerized NAV (even for the upcoming release)

Better restore and less dependencies for containerized NAV (even for the upcoming release)

27. March 2017

Better restore and less dependencies for containerized NAV (even for the upcoming release)

Again thanks to mainly Jakub Vaňák and a bit of work by myself you can now restore a .bak when your SQL container gets started and we’ve removed the identity framework dll (which isn’t working in a Container anyways).

What does this actually mean? If you check the GitHub repo, specifically the docker-compose.configs.yml you now see the possibility to specify restore_dbs:

restore_dbs: "[{'dbName':'NAVDB','bckFile':'C:\\\\SQLDB\\\\Demo Database NAV (10-0).bak'}]"

With that configuration you can specify a backup file for a database which is restored when you start the container for the first time. On each subsequent start the container will just re-use the existing data files as they are stored outside the container which means that you can even destroy the container and later on recreate it but still have persistent database changes. You could also opt to make the database specific to exactly one container by setting the use_hostname_folder param to true but that would mean that you can (out of the box) only use and persist the database and it’s changes for exactly one container. Depending on your use case that also might make sense.

We’ve also found a way to get rid of the identity foundation dll we had to copy to the image in previous version by just setting a number of registry keys (see this folder). However note that this only fixes the prerequisite checking but doesn’t mean that the identity foundation actually works! As you can see e.g. in the open issues #11 and 12) we currently face some problems with WebClient connections and syncing table changes which might or might not be connected with that. But it means that we could switch from calling the .msis to actually using the install cmdlet provided with the NAV installation medium as you can see in the Dockerfile for the NAV image:

RUN powershell Import-Module c:\install\content\DynamicsNavDvd\NavInstallationTools.psm1 -Force; \
Install-NAVComponent -ConfigFile c:\install\content\configs\Install-NavComponentConfig.xml

As always, if anyone reading this wants to discuss what Jakub and I are doing, please contact us, especially if you have any ideas what might cause the issues mentioned above.

On a closing note, as Infoma is part of the ACE for the upcoming the next NAV release I could try the containerization with those binaries as well and am happy to share that everything works as before! Which means we still can’t run the WebClient and can’t sync table changes but you can run the Windows Client and do everything else with the Dev environment. Next step will be to try to work with the in-client designer and Visual Studio Code with a containerized NAV installation. So again, this is to be continued…

Leave a Reply

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