Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Migrating to Multitenancy

Posted on by 18

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

  • Manish Sinha Profile Picture
    Manish Sinha 18 on at
    RE: Migrating to Multitenancy

    I understand there are multiple way to do this, I want to complete this using the MSDN article (msdn.microsoft.com/.../dn271703%28v=nav.80%29.aspx).

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Migrating to Multitenancy

    Please check this video

    www.youtube.com/watch

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans