My Errors & My Solutions
My Errors & My Solutions - It Could Happen To You
The concepts described in this post are applicable to different versions/builds, for the examples I will use an installation of NAV 2013 R2 (7.1.35473) and I will create one or more instances also for the build 7.1.36703 (Cumulative Update 7 – May 2014) in the same server.
HOW TO create NAV Instances with multiple builds in the same machine?
We have to distinguish two different operations:
- Creation of the first instance for a different build
- Add more instances for this build
HOW TO create the first instance for a different build?
Prerequisites:
- NAV 2013 R2 (7.1.35473) installed
- Cumulative Update package downloaded from Microsoft Partner Source website
After you installed NAV 2013 R2 Server side’s files will be inside the following path:
C:\Program Files\Microsoft Dynamics NAV\71\
Copy the folder 71 in a new folder 71 – Build 36703
C:\Program Files\Microsoft Dynamics NAV\71 - Build 36703\
Copy and replace all files from the NST folder, in the Cumulative Update package, to the Service folder in the following path:
C:\Program Files\Microsoft Dynamics NAV\71 - Build 36703\Service\
Run Microsoft Dynamics NAV 2013 R2 Administration Shell and execute the following PowerShell CmdLet:
New-Service 'MicrosoftDynamicsNAVServer$NewInstanceName' -BinaryPathName '"C:\Program Files\Microsoft Dynamics NAV\71 - Build 36703\Service\Microsoft.Dynamics.Nav.Server.exe" $NewInstanceName /config "C:\Program Files\Microsoft Dynamics NAV\71 - Build 36703\Service\Microsoft.Dynamics.NAV.Server.exe.config"' -DependsOn 'HTTP' -Description 'Service handling requests to Microsoft Dynamics NAV application.' -DisplayName 'Microsoft Dynamics NAV Server [NewInstanceName]' -StartupType Manual
Note: you can replace NewInstanceName with your preferred name (there are 3 references) or use another name for the folder “71 – Build 36703″ (there are 2 references)
In case of error, to delete this service use the following PowerShell CmdLet:
sc.exe delete 'MicrosoftDynamicsNAVServer$NewInstanceName'
Note: don’t remove the instance using Microsoft Dynamics NAV 2013 R2 Administration because, this is the Default instance for this build and it will be removed the Service folder from the 71 – Build 36703 folder.
HOW TO add more instances for this build?
In my example the name will be SecondInstanceName
Using Microsoft Dynamics NAV 2013 R2 Administration tool create a new instance with name SecondInstanceName.
Copy the SecondInstanceName folder from
C:\Program Files\Microsoft Dynamics NAV\71\Service\Instances\
to
C:\Program Files\Microsoft Dynamics NAV\71 - Build 36703\Service\Instances\
Note: if the subforder Instances doesn’t exist create it.
Using Microsoft Dynamics NAV 2013 R2 Administration tool delete the instance with name SecondInstanceName.
Run Microsoft Dynamics NAV 2013 R2 Administration Shell and execute the following PowerShell CmdLet:
New-Service 'MicrosoftDynamicsNAVServer$SecondInstanceName' -BinaryPathName '"C:\Program Files\Microsoft Dynamics NAV\71 - Build 36703\Service\Microsoft.Dynamics.Nav.Server.exe" $SecondInstanceName /config "C:\Program Files\Microsoft Dynamics NAV\71 - Build 36703\Service\Instances\SecondInstanceName\SecondInstanceName.config"' -DependsOn 'HTTP' -Description 'Service handling requests to Microsoft Dynamics NAV application.' -DisplayName 'Microsoft Dynamics NAV Server [SecondInstanceName]' -StartupType Manual
The difference with the previous command is only that now we will refer to the config file inside the Instances folder.
Note: you can replace SecondInstanceName with your preferred name (there are 5 references) or use another name for the folder “71 – Build 36703″ (there are 2 references)
The last step is to correct the config files inside the SecondInstanceName folder:
- SecondInstanceName.config – correct the paths in appsettings and tenants node replacing “71″ with “71 – Build 36703″
- CustomSettings.config – insert the correct values and ports and don’t foget to refer to the Default instance for this build in the following key:
<add key="DatabaseInstance" value="NewInstanceName" />
Did my HOW TO help you? Leave a reply.
HOW TO create NAV Instances with multiple builds in the same machine
Sergio Castelluccio