Tip of the Week #12 – Dealing with Multiple NAV Instances

This week’s Tip of the Week comes from PrintVis developer Peter Tijsma – Dealing with Multiple NAV Instances

When dealing with multiple NAV Instances connected to one database, you might run into the issue that the database schema is out of sync on other instances. This can happen when changing table objects, or importing a fob that contains table objects on the one instance to which your Development environment is currently connected.

A practical example of using multiple instances could be:

  • One instance used for Clients connecting using Window Credentials
  • One instance used for Clients connecting using UserName Credentials
  • One instance used for Clients connecting using NavUsernamePassword Credentials
  • One instance used for running a NAS for the NAV Job Queue
  • One instance used for running a NAS for PrintVis DCM Procssing
  • One instance used for running a NAS for PrintVis CIM Processing

Of course it would be ridiculous to reconnect separately to each instance and recompile the objects, or to restart all instances when users are still connected to them.

The Microsoft NAV team has provided some great Powershell tools to handle these issues and the one I’m frequently using is called: Sync-NAVTenant.

Check it out here.

This commandlet can be used perfectly together with another one called Get-NAVServerInstance, where you would now get a simple one-liner which can be run from the Microsoft Dynamics NAV Administrative Shell (which is a Powershell command prompt).

The end-result I’m using frequently is this one:

Get-NAVServerInstance | Where { $_.State -eq ‘Running’ } | Sync-NAVTenant -Mode Sync -Force

This will make sure that all running instances will have their database schemas updated from the application schemas.

My next Powershell trick will be about importing a NAV license without restarting NAV instances.

Enjoy!

Thank you Peter!