NAVY: A package manager for Dynamics NAV

After a discussion at the MVP Summit between some of the NAV MVPs a idea of an alternative to Microsoft’s new extensions appeared. And after some hours of coding, and about ~400 lines of code, here is “NAVY” – Microsoft extensions are called NAVX – Y is coming after X  therefor NAVY (Thanks Waldo).

This package manager is created for OnPremise installations, for installing verticals and horizontals into a standard NAV. Currently multi-tenant setup is not on my mind.

A NAVY package consist of metadata, new objects as FOB or TXT and DELTA files for changed standard objects.

NAVY can perform 5 operations:

  • BUILD a NAVY package with FOB/TXT objects and DELTA files
  • INSTALL a NAVY package into a database
  • UNINSTALL a NAVY package from a database
  • SUSPEND a NAVY package in a database
  • RESTORE a NAVY package in a database

The package life cycle

The main idea, is that you BUILD a package and then INSTALL that into a database. When you need to update the standard Dynamics objects you SUSPEND the objects (so the original objects are put back), upgrade NAV and then RESTORE the package back to its intended functionality.  If you want to get rid of the package you will use UNINSTALL so the original objects are reinstalled.

Installation

Download NAVY from here NAVY and extract the files from the zip file. The first thing to do is edit NAVY.exe.config and make sure that the paths points to your Dynamics NAV installation.

I have only tested with Dynamics NAV 2016, but it should work with 2013R2 and newer.

NAVY IS PRE-RELEASE SOFTWARE – DO NOT USE IN PRODUCTION !

Building a package

A package need a FOB file and some DELTA files. If you never have tried to create DELTA files, there are lots of good explanations on the net, here is Microsoft’s:

https://msdn.microsoft.com/en-us/library/dn789715%28v=nav.90%29.aspx

Waldo wrote a lot about it here http://www.waldo.be/2014/07/10/powershell-the-merge-commandlets-for-nav-2013/

A .NAVY file is just a ZIP file, so you can open the package with any ZIP tools.

Installing a package to a database

Installing is easy, make sure your NAVY.exe.config file points to the right executables, after that you simply type:

NAVY install Name=<packagename> DatabaseName=<databasename>

and NAVY will install the package.

After the installation has completed, a .NAVY.Backup file is created with the original objects. This file is required to do uninstalls and suspensions. Keep this file together with the .NAVY file.

Uninstalling a package from a database

Uninstalling a package is just a easy.

NAVY uninstall Name=<packagename> DatabaseName=<databasename>

NOTE: The objects installed from a FOB file is not removed  by the uninstall, only the changes to standard objects.

If fields are added to standard tables, uninstall will delete the field and thereby destroy the data – If that is not what you want, go look at the suspend command

Suspend a package on a database

If you want to upgrade the standard objects, its much easier to do if the original objects are back. This is what the suspend command does:

NAVY suspend Name=<packagename> DatabaseName=<databasename>

This will save values from fields added to standard tables before uninstall the changes and putting the original objects back.

In the .config file, you can specify what object number the table and codeunit used for storing data uses. Default is 50000.

After suspension has completed, you can upgrade NAV and then run the restore command.

Restore a package on a database

The restore command revert the suspension.

NAVY restore Name=<packagename> DatabaseName=<databasename>

The DELTA files are again applied and the saved data is being place back into the new fields.

NAVY is Open Source

Download the source from github, it is just a Visual Studio 2015 C# project with no external requirements. Fell free to change it into something useful. I love pull request 🙂

Access the source code at: https://github.com/hougaard/NAVY/