Hi all,
Wishing you all a very Happy New Year.
I was working on Mutlitenant and got stuck at one point.
Scenario -
I have 3 companies say A , B & Default.
I want Default in Default Tenant.
I want A & B in a separate tenant say MyTenant.
Here is what i have did till now-
Exported app in a different database.
Mounted App database on the service instance.
created the default Tenant (at this point all 3 companies are in default tenant).
Moved Company A to new Tenant (MyTenant) using below Powershell script -
HowTo-MoveCompanyToTenant -ServerInstance ‘DynamicsNAV71’ -DatabaseServer 'localhost\NAVDEMO' -FromDatabase 'ABC' -CompanyName 'A' -OldTenantName 'default' -NewTenantName 'MYTenant' -ServiceAccount 'NT AUTHORITY\NETWORK SERVICE' -RemoveCompanyWhenMoved
Worked like charm and Company A moved to MyTenant.
But now when i am trying to Move Company B from Default to Mytenant it end up with error.
HowTo-MoveCompanyToTenant -ServerInstance ‘DynamicsNAV71’ -DatabaseServer 'localhost\NAVDEMO' -FromDatabase 'ABC' -CompanyName 'B' -OldTenantName 'default' -NewTenantName 'MYTenant' -ServiceAccount 'NT AUTHORITY\NETWORK SERVICE' -RemoveCompanyWhenMoved
Error -
Mount-NAVTenant : Tenant 'MYTenant' already exists.
At
\Multitenancy\HowTo-MoveCompanyToTenant.ps1:126 char:5
+ Mount-NAVTenant -Id $NewTenantName -ServerInstance $ServerInstance -Database ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Mount-NAVTenant], FaultException`1
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$MultiTenent,Microsoft.Dynamics.Nav.Management.Cmdlets.MountNavTenant
I thought it is because MyTenant is Already Mounted, so i dismounted it from Service Instance and ran the command again.
It moved the comany to MyTenant but didnt removed it from default tenant.
ERROR -
Remove-NAVCompany : The Company does not exist. Identification fields and values: Name='B'
At
\Multitenancy\HowTo-MoveCompanyToTenant.ps1:151 char:11
+ Remove-NAVCompany -ServerInstance $ServerInstance -Tenant $OldTenantNa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Remove-NAVCompany], FaultException`1
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$MultiTenent/default,Microsoft.Dynamics.Nav.Management.Cmdlets.RemoveNavCompany
When i checked in SQL the Company B Exists in Both Tenants Default & MyTenant.
So how can i move multiple companies to a tenant and remove it from default tenant.
Thanks in advance
Answers
http://www.youtube.com/watch?v=N3Lj9FJDz3w&list=PL5B63EF419A3B59C8&index=35
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
sorry for delay and thanks for the link.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
Dismount-NAVTenant -Tenant 'MYTenant'
after moving the first company.
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com