Thursday, January 31, 2019

How to create multiple Instances in Dynamics NAV


How to create multiple Instances for different versions or Different CU (Cumulative Updates) in Dynamics NAV


Scenario: You have installed Dynamics NAV 2018 CU2 on your computer. After some time, you got to know that there is another cumulative update been released so you need to install new version without removing the old version.
Step 1,
Copy the Service folder from ‘C:\Program Files\Microsoft Dynamics NAV\110\Service’ and create a copy and rename it as Service-CU…





Step 2,
Copy and paste all files from the service folder in new version ‘C:\Downloads\CU 13 NAV 2018 AU\NAV.11.0.26893.AU.DVD\ServiceTier\program files\Microsoft Dynamics NAV\110\Service’
Please select replace all option.

Step 3,
Run the Dynamics NAV Administration Shell as an Administrator.


              



New-Service 'MicrosoftDynamicsNAVServer$New service' -BinaryPathName '"C:\Program Files\Microsoft Dynamics NAV\110\Service-CU…\Microsoft.Dynamics.Nav.Server.exe" $New service' /config "C:\Program Files\Microsoft Dynamics NAV\110\Service-CU…\Microsoft.Dynamics.NAV.Server.exe.config"' -DependsOn 'HTTP' -Description 'Service handling requests to Microsoft Dynamics NAV application.' -DisplayName 'Microsoft Dynamics NAV Server [New service']' -StartupType Manual

a.       Replace New service text with your New Server instance name
b.       Change the folder path of the new version path for Nav Server.exe and also for Nav Server.exe.config
c.       Run the script and it will create the new service




If you want to create a new server instance under an old version or create multiple server instances on new version please use below command.
 If you couldn’t find the Instances folder in side the main server instance folder, then creates a folder called ‘Instances’ and create another folder inside the Instances folder with New server instance name and copy the Custom Settings file from main folder and run the below command.
















New-Service 'MicrosoftDynamicsNAVServer$New service' -BinaryPathName '"C:\Program Files\Microsoft Dynamics NAV\110\Service\Microsoft.Dynamics.Nav.Server.exe" $New service' /config "C:\Program Files\Microsoft Dynamics NAV\110\Service\Instances\ New service\New Service.config"' -DependsOn 'HTTP' -Description 'Service handling requests to Microsoft Dynamics NAV application.' -DisplayName 'Microsoft Dynamics NAV Server [New service]' -StartupType Manual
Please note once the service is created you have to change the CustomSettings File
Run the Notepad as an Administrator and open the CustomeSettings file and check all the details



Please note if you need to delete those server instance you have created use below command running as an Administrator
sc.exe delete 'MicrosoftDynamicsNAVServer$NewService

Wednesday, January 30, 2019

How to Shrink Dynamics NAV SQL database or Transaction Log




How to Shrink your Dynamics NAV SQL database or Transaction Log

Step 1  Select and right click on the database --> Tasks -->Shrink --> Database







Step 2 Then it will show you Currently allocated space and Available free space as below


Step 3


Press ok
Then it will process and reduce the database size as below





  


If this method didn’t work try shrink files instead of database.


If both above didn’t work try below query, I can guaranty this would work

--You can find the logical name of the log file by using the following query:
SELECT name FROM sys.master_files WHERE type_desc = 'LOG'

USE NAV2018Production;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE NAV2018Production
SET RECOVERY SIMPLE;
GO



-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (NAV2018Production_Log, 100);
GO


-- Reset the database recovery model.
ALTER DATABASE NAV2018Production
SET RECOVERY FULL;
GO

 




Setting up Docker Containers for Dynamics 365 Business Central

Step 1: Please enable Hyper V and Container features from Programs and Features https://docs.microsoft.com/en-us/virtualization/hy...