Sync-NAVTenant
Sync-NAVTenant
Synchronizes a tenant database schema with an application database.
Syntax
Parameter Set: __AllParameterSets
Sync-NAVTenant [-ServerInstance] <String> [-Force] [-Mode <Int> ] [-Tenant <TenantId> ] [ <CommonParameters>]
Detailed Description
Use the Sync-NAVTenant cmdlet to synchronize the database schema in a tenant database with the schema in the application database.
The application database contains tables that define the application. The tenant database must contain the SQL Server tables that the application prescribes.
Parameters
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Mode<Int>
Specifies how the database schema for the tenant database is synchronized with the database schema that the mounted application database defines. The default value is Sync
. You can specify the parameter value by name or by integer as described in the following list:
ForceSync
= 0
The database schema in the tenant database is updated with the application database schema even if data is lost. For example, if a table or a field has been deleted in the current application, the table or field is removed from the tenant database even if it contains data.
Sync
= 2
The database schema in the tenant database will be updated unless data is lost. For example, if a table or a field has been deleted in the current application, and it contains data in the tenant database, the tenant cannot be mounted against the Microsoft Dynamics NAV Server instance.
CheckOnly
= 3
Microsoft Dynamics NAV Server tests if a change in the current application will result in data loss in the tenant database if the tenant is mounted with Mode set to ForceSync
. For example, if a table or a field has been deleted in the current application. and it contains data in the tenant database.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ServerInstance<String>
Specifies the Microsoft Dynamics NAV Server instance that the application database and the tenant database are mounted against, such as DynamicsNAV80. You can specify either the fully qualified name, such as 'MyServer$DynamicsNAV80', or the short name, such as 'DynamicsNAV80'.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue, ByPropertyName) |
Accept Wildcard Characters? |
false |
-Tenant<TenantId>
Specifies the ID of the tenant that you want to synchronize with the application, such as Tenant1. The tenant will be synchronized with the Microsoft Dynamics NAV application that is mounted against the same Microsoft Dynamics NAV Server instance.
This parameter is required unless the specified service instance is not configured to run multiple tenants.
Aliases |
Id |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
Examples
--------------------------EXAMPLE 1--------------------------
Description
-----------
This example synchronizes a tenant, 'Tenant1', with the application that is mounted against the specified Microsoft Dynamics NAV Server instance.
PS C:\> Sync-NAVTenant –ServerInstance DynamicsNAV80 -Tenant 'Tenant1'