Hi,
I am trying to prepare a multitenant environment for testing purpose. So far able to achieve this with multiple company in one tenant database. I want to create separate tenant database for each company. I checked the MSDN article around this but not able to achieve the result.
The below script will create 5 company in "Demo Database NAV (8-0)" database, separate the application & business data and finaly mound both database to the default tenant.
Run “Microsoft Dynamics NAV 2015 Administration Shell” as Administrator
Set-ExecutionPolicy unrestricted –Force
Step 1: Create new company and copy all data from an existing company
Copy-NAVCompany -ServerInstance DynamicsNAV80 -SourceCompanyName 'CRONUS International Ltd.' -DestinationCompanyName 'CRONUS A'
Copy-NAVCompany -ServerInstance DynamicsNAV80 -SourceCompanyName 'CRONUS International Ltd.' -DestinationCompanyName 'CRONUS B'
Copy-NAVCompany -ServerInstance DynamicsNAV80 -SourceCompanyName 'CRONUS International Ltd.' -DestinationCompanyName 'CRONUS C'
Copy-NAVCompany -ServerInstance DynamicsNAV80 -SourceCompanyName 'CRONUS International Ltd.' -DestinationCompanyName 'CRONUS D'
Copy-NAVCompany -ServerInstance DynamicsNAV80 -SourceCompanyName 'CRONUS International Ltd.' -DestinationCompanyName 'CRONUS E'
Step 2: Extracts the application tables form NAV database to a separate database.
Export-NAVApplication -DatabaseServer 'LPNOA1-46' -DatabaseName 'Demo Database NAV (8-0)' -DestinationDatabaseName 'Demo Database NAV (8-0)-App'
Step 3: Remove the application tables form NAV database
Remove-NAVApplication -DatabaseServer 'LPNOA1-46' -DatabaseName 'Demo Database NAV (8-0)' -Force
Step 4: Configures settings for a Microsoft Dynamics NAV Server instance
Set-NAVServerInstance –ServerInstance ‘DynamicsNAV80’ -stop
Set-NAVServerConfiguration –ServerInstance ‘DynamicsNAV80’ –element appSettings –KeyName ‘DatabaseName’ –KeyValue ‘’
Set-NAVServerInstance –ServerInstance ‘DynamicsNAV80’ –Start
Step 5: Mounts the Microsoft Dynamics NAV application against the specified server instance
Mount-NAVApplication –ServerInstance ‘DynamicsNAV80’ –DatabaseServer 'LPNOA1-46' –DatabaseName 'Demo Database NAV (8-0)-App'
Step 6: Mounts a tenant database against the specified Microsoft Dynamics NAV Server instance
Mount-NAVTenant –ServerInstance ‘DynamicsNAV80’ -Id Default –DatabaseServer ‘LPNOA1-46’ -DatabaseName ‘Demo Database NAV (8-0)’ –OverwriteTenantIdInDatabase
As I understood from the MSDN article the script should work like this:
.\HowTo-MoveCompanyToTenant -ServerInstance DynamicsNAV80 -FromDatabase 'Demo Database NAV (8-0)' -CompanyName 'CRONUS A' -OldTenantName default -NewTenantName 'CronusA'
Your assistance will be very much appreciated.
Thanks,
Manish Sinha
*This post is locked for comments