Mount-NAVTenantDatabase

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

Mount-NAVTenantDatabase
     [-ServerInstance] <String>
     [-Id] <TenantDatabaseId>
     [-DatabaseName] <String>
     [-DatabaseServer <String>]
     [-DatabaseCredentials <PSCredential>]
     [-Force]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

Use the Mount-NavTenantDatabase cmdlet to mount a tenant database on the specified Business Central Server instance. The database must already exist, it can be either an empty database or a valid Business Central database. Also, the Business Central Server instance must be configured for multitenancy.

When a database is mounted for the first time on a Business Central Server instance, the server instance can process requests for data on the tenant database, however, the tenant database is not in the Operational state because it has not been synchronized with the application database on the server instance. This means that you cannot yet create or mount tenants on the tenant database. To synchronize the tenant database and make it operational, use the Sync-NAVTenantDatabase cmdlet. When synchronized successfully, the application version of the application database on the server instance is then registered for support in tenant database.

A tenant database can be mounted on and synchronized with more than one server instance. The application database version of each server instance is registered for support in the tenant database. This enables you to have tenants in the tenant database that are using different application versions. This is useful, for example, when upgrading tenants to a newer application. An existing tenant can be upgraded to a newer application version by mounting it on the server instance that uses the newer application version, and then running a data upgrade.

Examples

EXAMPLE 1

Mount-NAVTenantDatabase -ServerInstance BC -Id 'Test_Database' -DatabaseName 'Test_Database' -DatabaseServer localhost\NAVDEMO

This example mounts a tenant database 'Test_Database' on the Business Central Server instance 'BC'. The tenant database is running on the localhost SQL Server instance 'NAVDEMO'.

EXAMPLE 2

Mount-NAVTenantDatabase BC -Id 'Test_Database' -DatabaseName 'Test_Database' -DatabaseServer localhost\NAVDEMO

This example mounts a tenant database 'Test_Database' on the Business Central Server instance 'BC'. The tenant database is running on the localhost SQL Server instance 'NAVDEMO'. The example uses positional arguments for the ServerInstance value.

EXAMPLE 3

Mount-NAVTenantDatabase BC -Id 'Test_Database'-DatabaseName 'Test_Database' -DatabaseServer localhost\NAVDEMO -DatabaseCredentials (Get-Credential)

This example mounts the tenant database 'Test_Database' on the Business Central Server instance 'BC'. The tenant database is running on the localhost SQL Server instance 'NAVDEMO'. The example configures SQL authentication on the connection to the database with credentials that are obtained from the Get-Credential cmdlet.

EXAMPLE 4

Get-NAVTenantDatabase -ServerInstance Server1 | Mount-NAVTenantDatabase -ServerInstance Server2

This example gets information about the tenant databases that are mounted on the Business Central Server instance 'Server1', and then mounts the tenant databases on the server instance 'Server2'. The tenant databases remain mounted on the server instance 'Server1' until you manually dismount them, but this is not required because a tenant database can be mounted on more than one server instance.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DatabaseCredentials

Specifies the user name and password of the login account that the Business Central Server instance will use to access the tenant database in SQL Server. This parameter configures the Business Central Server instance to use SQL Server Authentication instead of Windows Authentication on the connection to the database. The login account must be a member of the db_owner role on the database.

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DatabaseName

Specifies the name of the SQL Server database, such as MyDatabase, that you want to mount as a tenant database on the Business Central Server instance.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DatabaseServer

Specifies the SQL Server computer name and database instance that hosts the database to mount as a tenant database. You specify the value by using the format ComputerName\SQLServerInstance. The default database instance for Business Central is NAVDEMO.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

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

-Id

Specifies a unique identifier to assign the tenant database, such as MyTenantDatabase. The ID can be a maximum of 127 characters and consist of letters (Aa-Zz), numbers (0-9), or the following special characters: '.', '-', '@', '{', and '}'. It cannot start with '.', '}', or '-'. It cannot end with '{' or '-'. The ID is not case sensitive. You will use the ID to perform other operations on the tenant database, such as running the Sync-NAVTenantDatabase or Mount-NAVTenant cmdlet.

Type:TenantDatabaseId
Position:1
Default value:None
Required:True
Accept pipeline input:True
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
Required:True
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

By value and by property name: ServerInstance

Microsoft.Dynamics.Nav.Types.TenantDatabaseId

By property name: Id

System.String

By property name: DatabaseName

System.String

By property name: DatabaseServer