Skip to main content

NAV 2013 R2 - Multi-Tenancy Part 1

Hi all,

As discussed the concept of Mutlitenant in Previous post, let see how we can actually implement it.

Current State -

1. I have a NAV 2013 R2 database in SQL named as "ABC Company Database NAV 2013 R2" which we are going to convert to Mutlitenant.





2. The database have 5 companies as Shown Below.



3. The service instance used to connect is in port No. 8046 with Name as MultiTenent.

STEPS -

For Mutlitenant we Require the Windows Powershell ISE. (It Is Installed with NAV 2013 R2).
Just search it and Run it as Administrator.

1. Preparing the PowerShell -

We need to import NAV Admin Tool, to enable the NAV Commandlets.
-----------------------------------------------------------------------------------
#Prepare PowerShell
Set-ExecutionPolicy unrestricted -Force
Import-Module 'C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1'
-----------------------------------------------------------------------------------

Paste the Above Lines into Powershell and Run It.



2. Next Step is to Split the Application Data and Customer Data.

  Two Steps -
   a) Exporting the NAV Application From Source Database to a New Database.
   b) Remove the NAV Application From the Source Database.


Delete the content of Powershell and Paste Below Commands.
------------------------------------------------------------------------------------
#Split the Application Database and Customer Data
Export-NAVApplication -DatabaseServer "localhost\NAVDEMO" -DatabaseName "ABC Company Database NAV 2013 R2" -DestinationDatabaseName Customer_App_Data
Remove-NAVApplication -DatabaseServer "localhost\NAVDEMO" -DatabaseName "ABC Company Database NAV 2013 R2" -Force
------------------------------------------------------------------------------------
Change the Source and Target Database Name for Application Database. Run the Command and output will be as shown below.



So let's see the impact of The Two Steps Executed Till now. Open SQL Server and Check the Database. You will find a new database for application as shown below.



If you drill down the tables inside database you will see that i does not contain any tables related to customer data.



Commands used in this post can be found in My Sky Drive Folder.

File Name - Command 3 - Move Companies to tenants.ps1

In Next Post we will see how to set service to Support Mutlitenant and How to Mount Application and Customer Data into the Service Tier.

By Saurav Dhyani
saurav-nav.blogspot.in

Comments

Popular posts from this blog

BC 21 and Higher - PowerShell Cmdlet (Replacement of Business Central Administration).

Hi Readers, As discussed in last article about deprecating of Business Central Administration, there are few common actions that we use in administration till Business Central 20. For our on-prem customers, we will still require doing activities. As Microsoft suggest we need to start using PowerShell cmdlet.    Let's see how to do those via PowerShell, or Administration Shell. I will be keep adding commands as you comment to this article.

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing - 

MSDYN365BC - Data Upgrade To Microsoft Dynamics 365 Business Central on premises.

Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let's discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions - 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.