Convert-NAVTenant

The shared schema feature is for use in conjunction only with Microsoft hosted offerings in Dynamics 365, is unsupported in Business Central, and may not be used outside Dynamics 365.

Syntax

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.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-SharedSchema

Converts the database to the shared schema data model.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:TenantId
Aliases:Id
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Dynamics.Nav.Types.TenantId

By property name: Tenant

System.String

ServerInstance