Upgrading Unmodified C/AL Application to Version 16

Use this scenario if you have a Business Central Spring 2019 (version 14) application or earlier that doesn't include any code customization. Your solution might include Microsoft (first party) extensions and customization extensions (3rd-party). With this upgrade, you'll replace the C/AL base application with the new system and base application extensions. The result will be a fully upgraded Business Central 2020 release wave 1 (version 16) application and platform.

Upgrade on unmodified Business Central application.

General information

Single-tenant and multitenant deployments

The process for upgrading is similar for a single-tenant and multitenant deployment. However, there are some inherent differences. With a single-tenant deployment, the application code and business data are in the same database. In a multitenant deployment, application code is in a separate database (the application database) than the business data (tenant). In the procedures that follow, for a single-tenant deployment, consider references to the application database and tenant database as the same database. Steps are marked as Single-tenant only or Multitenant only where applicable.

Personalization and customizations

Since version 14, the way user profiles are defined, stored, and customized has undergone a major overhaul. This change means user personalization and profile customizations that were done in the Windows Client are lost after upgrade. The legacy profiles remain available but their associated profile configurations are discarded. Page customizations must be either recreated using the latest Business Central client or as an AL extension. For more information about personalization, customization, and Al profiles, see:

Prerequisite

  1. Upgrade to Business Central Spring 2019 (version 14).

    • If your solution is already on version 14, then no action on this step is required.
    • If you're upgrading from Business Central Fall 2018 (version 13) or Dynamics NAV, we recommend you upgrade to the latest update for version 14 that has a compatible update for version 16. For more information, see Dynamics 365 Business Central Upgrade Compatibility Matrix.

    To download the latest update, go to Released Cumulative Updates for Microsoft Dynamics 365 Business Central Spring 2019 Update on-premises.

    For information about how to do the upgrade, see Upgrading to Dynamics 365 Business Central On-Premises.

  2. Disable data encryption.

    If the current server instance uses data encryption, disable it. You can enable it again after upgrading.

    For more information, see Managing Encryption and Encryption Keys.

    Instead of disabling encryption, you can export the current encryption key, which you'll then import after upgrade. However, we recommend disabling encryption before upgrading.

Task 1: Install version 16

  1. Download the latest available update for version 16 that is compatible with your version 14.

    To download the latest update, go to Released Updates for Microsoft Dynamics 365 Business Central 2019 Release Wave 2 on-premises.

    The guidelines in this article assume that you're running the latest available update.

  2. Before you install version 16, it can be useful to create desktop shortcuts to the version 14.0 tools, such as the Business Central Server Administration tool, Business Central Administration Shell, and Dynamics NAV Development Shell because the Start menu items for these tools will be replaced with the version 16 tools.

  3. Install Business Central version 16 components.

    You'll have to keep version 14 installed to complete some steps in the upgrade process. When you install version 16, you must either specify different port numbers for components (like the Business Central Server instance and web services) or stop the version 14.0 Business Central Server instance before you run the installation. Otherwise, you'll get an error that the Business Central Server failed to install.

    For more information, see Installing Business Central Using Setup.

Task 2: Prepare version 14 databases

  1. Make backup of the databases.

  2. Start Business Central Administration Shell for version 14 as an administrator.

    For more information, see Run Business Central Administration Shell.

  3. Uninstall all extensions from the old tenants.

    In this step, you uninstall any extensions that are currently installed on the database.

    1. Get a list of installed extensions.

      This step is optional, but it can be useful to the names and versions of the extensions.

      To get a list of installed extensions, use the Get-NAVAppInfo cmdlet.

      Get-NAVAppInfo -ServerInstance <server instance name> -Tenant <tenant ID>
      

      For a single-tenant deployment, set the <tenant ID> to default.

    2. Uninstall the extensions.

      To uninstall an extension, you use the Uninstall-NAVApp cmdlet.

      Uninstall-NAVApp -ServerInstance <server instance name> -Name <extensions name> -Tenant <tenant ID> -Version <extension version> -Force
      

      Replace <extension name> and <extension version> with the exact name and version the published System Application.

      For example, together with the Get-NAVApp cmdlet, you can uninstall all extensions with a single command:

      Get-NAVAppInfo -ServerInstance <server instance name> -Tenant <tenant ID>| % { Uninstall-NAVApp -ServerInstance <server instance name> -Tenant <tenant ID> -Name $_.Name -Version $_.Version -Force}
      
  4. Unpublish all extensions from the application server instance.

    To unpublish an extension, use the Unpublish-NAVApp cmdlet:

    Unpublish-NAVApp -ServerInstance <server instance name> -Name <extension name> -Version <extension version>
    

    Together with the Get-NAVAppInfo cmdlet, you can unpublish all extensions by using a single command:

    Get-NAVAppInfo -ServerInstance <BC14 server instance> | % { Unpublish-NAVApp -ServerInstance <BC14 server instance> -Name $_.Name -Version $_.Version }
    
  5. Unpublish all system, test, and application symbols.

    To unpublish symbols, use the Unpublish-NAVAPP cmdlet with the -SymbolsOnly switch.

    Get-NAVAppInfo -ServerInstance <BC14 server instance> -SymbolsOnly | % { Unpublish-NAVApp -ServerInstance <BC14 server instance> -Name $_.Name -Version $_.Version }
    

    What are symbols?

  6. (Multitenant only) Dismount the tenants from the application server instance.

    To dismount a tenant, use the Dismount-NAVTenant cmdlet:

    Dismount-NAVTenant -ServerInstance <server instance name> -Tenant <tenant ID>
    
  7. Stop the server instance.

    Stop-NAVServerInstance -ServerInstance <server instance name>
    

Task 3: Convert the version 14 database

This task runs a technical upgrade on the application database to convert it from the version 14 platform to the version 16 platform. The conversion updates the system tables of the database to the new schema (data structure). It provides the latest platform features and performance enhancements.

  1. If the database is on Azure SQL Database, you may get add your user account to the dbmanager database role on the master database.

    This membership is only required for converting the database, and can be removed afterwards. This step isn't required for Azure SQL Managed Instance.

  1. Start Business Central Administration Shell for version 16 as an administrator.

  2. Run the Invoke-NAVApplicationDatabaseConversion cmdlet to start the conversion:

    Invoke-NAVApplicationDatabaseConversion -DatabaseServer <database server name>\<database server instance> -DatabaseName "<database name>"
    

    When completed, a message like the following displays in the console:

    DatabaseServer      : .\BCDEMO
    DatabaseName        : Demo Database BC (14-0)
    DatabaseCredentials :
    DatabaseLocation    :
    Collation           :
    

Note

When the database is on Azure SQL Database, you may get the following error:

SQL Server: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated.

If you do, scale up the database resources in Azure SQL, then run the Invoke-NAVApplicationDatabaseConversion cmdlet again. If the conversion is successful, you can then scale it back down to its original setting and continue the upgrade.

Task 4: Configure version 16 server for DestinationAppsForMigration

When you installed version 16 in Task 1, a version 16 Business Central Server instance was created. In this task, you change server configuration settings that are required to complete the upgrade. Some of the changes are only required for version 14 to version 16.0 upgrade and can be reverted after you complete the upgrade.

  1. Set the server instance to connect to the application database.

    Set-NAVServerConfiguration -ServerInstance <server instance name> -KeyName DatabaseName -KeyValue "<database name>"
    

    In a single tenant deployment, this command will mount the tenant automatically. For more information, see Connecting a Server Instance to a Database.

  2. Configure the server instance for migrate extensions to the use the new base application and system application extensions.

    Set-NAVServerConfiguration -ServerInstance <server instance name> -KeyName "DestinationAppsForMigration" -KeyValue '[{"appId":"63ca2fa4-4f03-4f2b-a480-172fef340d3f", "name":"System Application", "publisher": "Microsoft"},{"appId":"437dbf0e-84ff-417a-965d-ed2bb9650972", "name":"Base Application", "publisher": "Microsoft"}]'
    

    This setting serves the following purposes:

    • When you run the data upgrade on a tenant, the server will run the data upgrade for the base and system application extensions. The base and system applications will be automatically installed on the tenant also.
    • Lets you republish extensions that haven't been built on version 16. The extensions typically include the third-party extensions that were used in your version 14. When you publish the extensions, the extension manifests are automatically modified with a dependency on the base and system applications.

    For more information about this setting, see DestinationAppsForMigration.

  3. Disable task Scheduler on the server instance for purposes of upgrade.

    Set-NavServerConfiguration -ServerInstance <server instance name> -KeyName "EnableTaskScheduler" -KeyValue false
    

    Be sure to re-enable task scheduler after upgrade if needed.

  4. Restart the server instance.

    Restart-NAVServerInstance -ServerInstance <server instance name>
    

Task 5: Increase application version

This task is optional, but it's recommended. You can choose to skip it for now and do it later. In this task, you'll increase the application_version that's stored in $ndo$dbproperty table of the application database. The application version isn't changed automatically. The application version serves two purposes:

  • Enables running the Start-NAVDataUpgrade cmdlet later in Task 8 of this article. The application version is compared with the tenant's version. If the application version is greater, a data upgrade can be run. If you skip this task, you'll have to use the -SkipAppVersionCheck switch with Start-NAVDataUpgrade cmdlet in Task 9.
  • The application version is shown in the client on the Help and Support page. This task ensures that page displays the latest application version.

The version has the format major.minor.build.revision, such as, '14.3.14824.1'. As a minimum, you increase the revision by 1. However, we recommend setting the value to application build number for the version 16 update. You can get this number from the Released Updates for Microsoft Dynamics 365 Business Central 2019 Release Wave 2 on-premises page.

To change the application version, run the Set-NAVApplication cmldet:

Set-NAVApplication -ServerInstance <server instance name> -ApplicationVersion <new application version> -Force

For example:

Set-NAVApplication -ServerInstance BC160 -ApplicationVersion 16.0.38071.0 -Force

Later, when you synchronize and upgrade the tenant(s), the new application version will be updated in the tenant database ($ndo$tenantproperty table).

Task 6: Import version 16 license

  1. Use the Import-NAVServerLicense to upload the version 16 license to the database.

    Import-NAVServerLicense -ServerInstance <server instance name> -LicenseFile <path and file name>
    
  2. Restart the server instance.

    Restart-NAVServerInstance -ServerInstance <server instance name>
    

Task 7: Publish symbols and extensions

In this task, you'll publish the platform symbols and extensions. As minimum, you publish the new base application and system application extensions from the installation media (DVD). You also publish new versions of any Microsoft extensions and third-party extensions that were used on your old deployment.

Publishing an extension adds the extension to the application database that is mounted on the server instance. Once published, it's available for installing on tenants. This task updates internal tables, compiles the components of the extension behind-the-scenes, and builds the necessary metadata objects that are used at runtime.

The steps in this task continue to use the Business Central Administration Shell for version 16 that you started in the previous task.

  1. Publish version 16 system symbols extension.

    The symbols extension contains the required platform symbols that the base application depends on. The symbols extension package is called System.app. You find it where the AL Development Environment is installed. The default path is C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\160\AL Development Environment.

    Publish-NAVApp -ServerInstance  <server instance name> -Path "<path to system.app>" -PackageType SymbolsOnly
    

    What are symbols?

  2. Publish the System Application extension (Microsoft_System Application.app).

    You find the (Microsoft_System Application.app in the Applications\System Application\Source folder of installation media (DVD).

    Publish-NAVApp -ServerInstance <server instance name> -Path "<path to Microsoft_System Application.app>"
    

    What is the System Application?

  3. Publish the Business Central base application extension (Microsoft_Base Application.app).

    The Base Application extension contains the application business objects. You find the (Microsoft_Base Application.app in the Applications\BaseApp\Source folder of installation media (DVD).

    Publish-NAVApp -ServerInstance <server instance name> -Path "<path to Microsoft_Base Application.app>"
    
  4. Publish the Microsoft_Application extension

    The Microsoft_Application extension is a new extension introduced in 15.3. For more information about this extension, see The Microsoft_Application.app File.

    Publish-NAVApp -ServerInstance <server instance name> -Path "<folder path>\Microsoft_Application.app"
    
  5. Publish the new versions of Microsoft extensions.

    In this step, you publish new versions of Microsoft extensions that were used on your version 14 deployment. You find the extensions in the Applications folder of the installation media (DVD).

    Publish-NAVApp -ServerInstance <server instance name> -Path "<path to Microsoft extension>"
    

    For example:

    Publish-NAVApp -ServerInstance BC160 -Path "C:\W1DVD\Applications\SalesAndInventoryForecast\Source\SalesAndInventoryForecast.app"
    
  6. Publish 3rd-party extensions.

    Publish 3rd-party extensions that were used on your version 14 solution. If you have new versions of these extensions, built on the Business Central version 16, then publish the new versions. Otherwise, republish the same versions that were previously published in the old deployment.

    Publish-NAVApp -ServerInstance BC150 -Path "<path to extension>"
    

Task 8: Restart server instance

Restart the Business Central Server to free up resources for completing the upgrade.

Restart-NAVServerInstance -ServerInstance <server instance name>

This step is important, otherwise you might experience issues when you run the data upgrade.

Task 9: Synchronize tenant

In this task, you'll synchronize the tenant's database schema with any schema changes in the application database and extensions.

If you have a multitenant deployment, do these steps for each tenant.

  1. (Multitenant only) Mount the tenant to the version 16 server instance.

    To mount the tenant, use the Mount-NAVTenant cmdlet:

    Mount-NAVTenant -ServerInstance <server instance name> -DatabaseName <database name> -DatabaseServer <database server>\<database instance> -Tenant <tenant ID> -AllowAppDatabaseWrite
    

    Important

    You must use the same tenant ID for the tenant that was used in the old deployment; otherwise you'll get an error when mounting or syncing the tenant. If you want to use a different ID for the tenant, you can either use the -AlternateId parameter now or after upgrading, dismount the tenant, then mount it again using the new ID and the OverwriteTenantIdInDatabase parameter.

    Note

    For upgrade, we recommend that you use the -AllowAppDatabaseWrite parameter. After upgrade, you can dismount and mount the tenant again without the parameter if needed.

    At this stage, the tenant state is OperationalWithSyncPending.

  2. Synchronize the tenant with the application database.

    Use the Sync-NAVTenant cmdlet:

    Sync-NAVTenant -ServerInstance <server instance name> -Mode Sync -Tenant <tenant ID>
    

    With a single-tenant deployment, you can omit the -Tenant parameter and value.

  3. Synchronize the tenant with the System Application extension.

    Use the Sync-NAVApp cmdlet:

    Sync-NAVApp -ServerInstance <server instance name> -Tenant <tenant ID> -Name "System Application" -Version <extension version>
    

    Replace <extension version> with the exact version of the published System Application. To get the version, you can use the Get-NAVAppInfo cmdlet.

  4. Synchronize the tenant with the Business Central Base Application extension.

    Sync-NAVApp -ServerInstance <server instance name> -Tenant <tenant ID> -Name "Base Application" -Version <extension version>
    

    Replace <extension version> with the exact version of the published Base Application.

  5. Synchronize the tenant with the Application extension.

    Sync-NAVApp -ServerInstance <server instance name> -Tenant <tenant ID> -Name "Application"
    
  6. Synchronize the tenant with Microsoft and 3rd-party extensions.

    For each extension, run the Sync-NAVApp cmdlet:

    Sync-NAVApp -ServerInstance BC160 -Tenant default -Name "<extension name>" -Version <extension version>
    

Tip

When you synchronize an extension, the extension takes ownership of any tables that it includes. In SQL Server, you'll notice that the table names will be suffixed with the extension ID. For example, Base Application tables will have 437dbf0e-84ff-417a-965d-ed2bb9650972 in the name. In addition, the systemId column is added to application tables that are not already part of an extension.

Task 10: Upgrade data

In this task, you run a data upgrade on tables to handle data changes made by platform and extensions.

If you have a multitenant deployment, do these steps for each tenant.

  1. Upgrade the data to the platform, system application, and base application.

    1. To run the data upgrade, use the Start-NavDataUpgrade cmdlet:

      Start-NAVDataUpgrade -ServerInstance <server instance name> -Tenant <tenant ID> -FunctionExecutionMode Serial [-SkipAppVersionCheck]
      

      You only need to use the -SkipAppVersionCheck if you didn't increase the application version in Task 5.

    2. To view the progress of the data upgrade, you can run Get-NavDataUpgrade cmdlet with the –Progress switch.

    This step will automatically install the base application and system application on the tenant.

  2. Upgrade the new versions of Microsoft extensions and third-party extensions.

    Complete this task to upgrade any Microsoft extension and third-party extension. Microsoft extensions used in the old deployment to new versions on the installation media. The new versions are in the Application folder of the DVD. There's a folder for each extension. The extension package (.app file) is in the Source folder.

    1. Install Application extension.

      You'll have to install the Application extension first, otherwise you can't upgrade Microsoft extensions.

      Install-NAVApp -ServerInstance <server instance name> -Tenant <tenant ID> -Name "Application"
      
    2. For each extension, run Start-NAVAppDataUpgrade cmdlet:

      Start-NAVAppDataUpgrade -ServerInstance <server instance name> -Name "<extension name>" -Version <extension version>
      

      This step will also automatically install the new extension version on the tenant.

  3. (Multitenant only) Repeat steps 1 through 3 for each tenant.

Task 11: Install 3rd-party extensions

Complete this task to install third-party extensions for which a new version wasn't published. For each extension, run the Install-NAVApp cmdlet:

Install-NAVApp -ServerInstance <server instance name> -Name <extension name> -Version <extension version>

Task 12: Upgrade control add-ins

The Business Central Server installation includes new versions of the Microsoft-provided Javascript-based control add-ins, like Microsoft.Dynamics.Nav.Client.BusinessChart, Microsoft.Dynamics.Nav.Client.VideoPlayer, and more. If your solution uses any of these control add-ins, upgrade them to the latest version.

To upgrade the control add-ins from the client, do the following steps:

  1. Open the Business Central client.

  2. Search for and open the Control Add-ins page.

  3. Choose Actions > Control Add-in Resource > Import.

  4. Locate and select the .zip file for the control add-in and choose Open.

    The .zip files are located in the Add-ins folder of the Business Central Server installation. There's a subfolder for each add-in. For example, the path to the Business Chart control add-in is C:\Program Files\Microsoft Dynamics 365 Business Central\160\Service\Add-ins\BusinessChart\Microsoft.Dynamics.Nav.Client.BusinessChart.zip.

  5. After you've imported all the new control add-in versions, restart Business Central Server instance.

Alternatively, you can use the Set-NAVAddin cmdlet of the Business Central Administration Shell. For example, the following commands update the control add-ins installed by default. Modify the commands to suit:

$InstanceName = 'BC160'
$ServicesAddinsFolder = 'C:\Program Files\Microsoft Dynamics 365 Business Central\160\Service\Add-ins'
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.BusinessChart' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'BusinessChart\Microsoft.Dynamics.Nav.Client.BusinessChart.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.FlowIntegration' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'FlowIntegration\Microsoft.Dynamics.Nav.Client.FlowIntegration.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.OAuthIntegration' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'OAuthIntegration\Microsoft.Dynamics.Nav.Client.OAuthIntegration.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.PageReady' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'PageReady\Microsoft.Dynamics.Nav.Client.PageReady.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.PowerBIManagement' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'PowerBIManagement\Microsoft.Dynamics.Nav.Client.PowerBIManagement.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.RoleCenterSelector' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'RoleCenterSelector\Microsoft.Dynamics.Nav.Client.RoleCenterSelector.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.SatisfactionSurvey' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'SatisfactionSurvey\Microsoft.Dynamics.Nav.Client.SatisfactionSurvey.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.SocialListening' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'SocialListening\Microsoft.Dynamics.Nav.Client.SocialListening.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.VideoPlayer' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'VideoPlayer\Microsoft.Dynamics.Nav.Client.VideoPlayer.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.WebPageViewer' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'WebPageViewer\Microsoft.Dynamics.Nav.Client.WebPageViewer.zip')
Set-NAVAddIn -ServerInstance $InstanceName -AddinName 'Microsoft.Dynamics.Nav.Client.WelcomeWizard' -PublicKeyToken 31bf3856ad364e35 -ResourceFile ($AppName = Join-Path $ServicesAddinsFolder 'WelcomeWizard\Microsoft.Dynamics.Nav.Client.WelcomeWizard.zip')

At this point, the upgrade is complete, and you can open the client.

Post-upgrade tasks

  1. Enable task scheduler on the server instance.

  2. (Multitenant only) For tenants other than the tenant that you use for administration purposes, if you mounted the tenants using the -AllowAppDatabaseWrite parameter, dismount the tenants, then mount them again without using the -AllowAppDatabaseWrite parameter.

  3. If you want to use data encryption as before, enable it.

    For more information, see Managing Encryption and Encryption Keys.

    Optionally, if you exported the encryption key instead of disabling encryption earlier, import the encryption key file to enable encryption.

  4. Grant users permission to the Open in Excel and Edit in Excel actions.

    Version 16 introduces a system permission that protects these two actions. The permission is granted by the system object 6110 Allow Action Export To Excel. Because of this change, users who had permission to these actions before upgrading, will lose permission. To grant permission again, do one of the following steps:

    • Assign the EXCEL EXPORT ACTION permission set to appropriate users.
    • Add the system object 6110 Allow Action Export To Excel permission directly to appropriate permission sets.

    For more information about working with permission sets and permissions, see Export and Import Permission Sets.

See Also

Publishing and Installing an Extension
Upgrading to Business Central
Upgrading Extensions