Convert-NAVTenant
DO NOT USE: This cmdlet is for internal use only. It can't be used for Business Central on-premises tenants. For information about managing on-premises tenants, see https://go.microsoft.com/fwlink/?linkid=2153727.
Syntax
Default (Default)
Convert-NAVTenant
[-Tenant <TenantId>]
[-CommitPerTable]
[-SharedSchema]
[-ServerInstance] <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Converts the database from a separate schema data model (which is the default) to a shared schema data model. With shared schema, companies share tables for storing business data, as opposed to each company having their own set of tables. For example, instead of an Item table for each company, there is a single Item table for all companies in the database. In a multitenant deployment, shared schema enables you to have more than one tenant in the database. Be aware that once you convert a database to shared schema, it cannot be reverted to separate schema.
You can use the Convert-NAVTenant cmdlet only when the tenant is synchronized with the application. If the tenant is out of sync, use the Sync-NAVTenant cmdlet first.
Examples
EXAMPLE 1
Convert-NAVTenant -ServerInstance BC -Tenant 'Tenant1'
This example converts a tenant database, 'Tenant1', from a separate schema data model to a shared schema data model.
Parameters
-CommitPerTable
Specifies that database schema modifications are committed by separate transactions on each affected table. Transactions are run one at a time, as they occur.
With the default behavior (that is, without using the -CommitPerTable parameter), all modifications are committed in a single transaction. Using this method provides better protection against leaving the database in an inconsistent state than using the -CommitPerTable parameter. If the conversion process is terminated before it is completed, any changes that were made before the problem occurred are rolled back, returning the database to its original state. The drawback is that for large databases, the conversion process can take a long time and consume considerable computer resources.
The advantage of setting the -CommitPerTable is that it will decrease the time that is required to complete the conversion process and consume less computer resources, which can be useful for large databases when performance is a concern. However, when you set this parameter, committed changes are not rolled back if the conversion process is terminated before it is completed. This can result in a partially converted database, which might leave the database inoperable. We recommend that you make a backup of the database before you run the Convert-NavTenant cmdlet. Also, tables are not always locked during conversion. Therefore, you should prohibit users from connecting to the database during the conversion.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Force
Forces the command to run without asking for user confirmation.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ServerInstance
Specifies the name of a Business Central Server instance, for example, BC or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-SharedSchema
Converts the database to the shared schema data model.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Tenant
Specifies the ID of the tenant that you want to convert to shared schema, such as Tenant1.
This parameter is required unless the specified service instance is not configured for multitenancy.
Parameter properties
| Type: | TenantId |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | Id |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Microsoft.Dynamics.Nav.Types.TenantId
By property name: Tenant
System.String
ServerInstance