How to upgrade data to the latest Business Central in a multitenant deployment?

Network of MS Dynamics D365, AX, NAV, GP, SL, CRM, RMS, POS professionals Forums Microsoft Dynamics NAV / Navision NAV Installation & Administration How to upgrade data to the latest Business Central in a multitenant deployment?

This topic contains 2 replies, has 3 voices, and was last updated by  Locus IT 3 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20572

    Deepak
    Participant

    How to upgrade data to the latest Business Central in a multitenant deployment?

    #20975

    Locus IT
    Participant

    Hi Deepak,

    You use data conversion tools provided with Business Central to convert the old data with the old version’s table and field structure so that it functions together with the new version’s table and field structure. Mainly, only table objects and table data are modified during the data upgrade process. Other objects, such as pages, reports, codeunits, and XMLports are upgraded as part of the application code upgrade process.

    Prerequisites

    Before you start the upgrade tasks, make sure you have the following prerequisites:

    1. Your computer uses the same codepage as the data that will be upgraded.If you use conflicting codepages, some characters will not display in captions, and you might not be able to access the upgraded database. This is because Business Central must remove incorrect metadata characters to complete the data upgrade. In this case, after the upgrade, you must open the database in the development environment on a computer with the relevant codepage and compile all objects. This adds the missing characters again.
    2. (Upgrading from Dynamics NAV only) Custom V1 extensions used in Dynamics NAV have been converted to V2 extensions.

    3. Business Central has been installed with the upgraded application and upgrades toolkit.

    As a minimum, you must install the following components:

      • Business Central Server instance connected to the application database.
      • Dynamics NAV Development Environment for Business Central
      • AL Development EnvironmentThis installs the required system and test symbols for V2 extensions.
      • Business Central Server Administration tool (optional)
      • Business Central Web Server components (not required for an upgrade).Business Central has been installed with the upgraded application and upgrades toolkit.

        As a minimum, you must install the following components:

    4. Permission sets (except SUPER) and permissions have been exported from the old tenant database.

      • When upgrading from Dynamics NAVTo export permission sets and permissions, you run running XMLPort 9171 and 9172.

        It is important that you exclude the SUPER permission set when running XMLPort 9171. You can do this by adding the filter Role ID is <>SUPER.

      • When upgrading from an earlier version of Business CentralIn the client, search for and open the Permission Sets page, select the user-defined permission sets that you want to keep, and then choose Export Permission Sets.

    5. If the old application uses data encryption, you have the encryption key file that is used for the data encryption.

    Prepare the tenant database for data upgrade

    You perform these tasks on each tenant that you want to upgrade.

    1. Backup the tenant database.

    Create a full backup of the old database in the SQL Server. Alternatively, you can make a copy of the old database and perform the upgrade tasks on the copy.

    2. (Dynamics NAV upgrade only) Uninstall all V1 extensions.

    Make sure that all V1 extensions are uninstalled. Open the Dynamics NAV Administration Shell that matches to the old database, and run these commands:

    a) To get a list of the V1 extensions that are installed, run this command:

    Get-NAVAppInfo -ServerInstance <OldServerInstanceName> -Tenant <TenantID>
    

    V1 extensions are indicated by CSIDE in the Extension Type column. 2. For each extension, run the Uninstall-NAVApp cmdlet to uninstall it:

    Uninstall-NAVApp -ServerInstance <OldServerInstanceName> -Name <Name> -Version <N.N.N.N>
    

    3. Dismount the tenant.

    Before you upgrade the tenant, you must dismount it from the old server instance. To dismount the tenant, run the Dismount-NAVTenant cmdlet:

    Dismount-NAVTenant -ServerInstance <OldServerInstanceName> -Tenant <TenantID>
    

    Run the data upgrade on the tenant

    You perform these tasks on each tenant that you want to upgrade.

    1. Mount the tenant.

    Mount the tenant on the new Business Central Server instance that connects to the new application database. To mount the tenant, use the Mount-NAVTenant cmdlet:

    Mount-NAVTenant -ServerInstance <ServerInstanceName> -DatabaseName <Database name> -DatabaseServer <server\instance> -Tenant <TenantID> -AllowAppDatabaseWrite
    

    2. Synchronize the tenant.

    Synchronize the tenant database schema with validation by running the Sync-NAVTenantcmdlet from the Business Central Administration Shell.

    Sync-NAVTenant -ServerInstance <ServerInstanceName> -Tenant <TenantID>
    

    When completed, the tenant should have the status OperationalDataUpgradePending or, if there are published extensions with newer versions than on the tenant, OperationalSyncPending. To verify this, run the following cmdlet:

    Get-NAVTenant -ServerInstance <ServerInstanceName> -tenant default -ForceRefresh
    

    3. If there are published extensions with newer versions than on the tenant, synchronize all published extensions with the tenant database.

    Synchronize the schema with the database by running the Sync-NAVApp cmdlet for each extension version:

    Sync-NAVApp -ServerInstance <ServerInstanceName> -Name <Name> -Version <N.N.N.N> -Tenant <TenantID>
    

    Or, to synchronize all published extensions using one command:

    Get-NAVAppInfo -ServerInstance <ServerInstanceName> -Tenant <TenantID> | % { Sync-NAVApp -ServerInstance <ServerInstanceName> -Name $_.Name -Version $_.Version }
    

    When completed, the tenant should have the status OperationalDataUpgradePending.

    4. Run the data upgrade.

    A data upgrade runs the upgrade toolkit objects, such as upgrade codeunits and upgrades tables, to migrate business data from the old table structure to the new table structure. It will also upgrade the published extensions.

    You can start the data upgrade by running the run Start-NavDataUpgrade cmdlet the Business Central Administration Shell:

    Start-NavDataUpgrade -ServerInstance <ServerInstanceName>
    

    Important: If you have extensions, then you must run the data upgrade so that it executes functions in the serial mode as follows.

    Start-NavDataUpgrade -ServerInstance <ServerInstanceName> -Tenant <tenantID> -FunctionExecutionMode Serial
    

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

    The data upgrade process runs CheckPreconditions and Upgrade functions in the upgrade codeunits. If any of the preconditions are not met or an upgrade function fails, you must correct the error and resume the data upgrade process. If CheckPreconditions and Upgrade functions are executed successfully, codeunit 2 is automatically run to initialize all companies in the database unless you set the -SkipCompanyIntitialization parameter.

    5. Install extensions on the tenant.

    Install the desired extensions on the tenant by running the Install-NAVApp cmdlet:

    Install-NAVApp -ServerInstance <ServerInstanceName> -Name <Name> -Version <N.N.N.N>
    

    Post-upgrade tasks

    1. Import permission sets and permissions

      Import the permission sets and permissions XML files that you exported from the old database as follows:

      • For upgrade from Dynamics NAV:
        1. Open table 2000000004 Permission Sets in the client, and delete all permission sets except SUPER.
        2. Run XMLport 9171 and XMLport 9172 to import the permission sets and permission XML files.
        • For upgrade from an earlier Business Central version:

          1. In the client, search for and open the Permission Sets page.
          2. Delete all user-defined permissions.
          3. Choose Import Permission Sets, then select the permissions set file that you exported previously.

    2. Import encryption keys.

    3. (Optional) Update Web Server instance configuration file

    If you have installed the Business Central Web Server, populate the navsettings.json file for the Business Central Web Server instance with the settings of the old web.config file or navsettings.json.

        • If the old deployment used a web.config file, then you have to manually change the settings in the navsetting.json file that is used on the new Business Central Web Server instance.
        • If you upgraded from Business Central October 2018, you can replace the navsettings.json file on the new Business Central Web Server instance with the old file. However, as of Business Central April 2019, the following settings are now configured under a root element called ApplicationIdSettings instead of the root element NAVWebSettings.
          • AndroidPrivacy
          • AndroidSoftwareLicenseTerms
          • AndroidThirdPartyNotice
          • BaseHelpUrl
          • BaseSettingsSectionName
          • CommunityLink
          • FeedbackLink
          • IosPrivacy
          • IosSoftwareLicenseTerms
          • IosThirdPartyNotice
          • KeyboardShortcutsLink
          • PrivacyLink
          • LegalLink
          • SignInHelpLink

          If the old navsettings.json file uses any of these settings, then you will have to move them from the NAVWebSettings element to the ApplicationIdSettings element.

    4. Upload the customer license.

    #20579

    John
    Participant

    Hello Deepak,

    In a multitenant deployment, information about the Microsoft Dynamics NAV application is stored in a separate application database. Your customers’ data is stored in separate business databases, each of which is a tenant in your deployment. By separating the application from data, you can deploy the same solution to many customers with centralized maintenance of the application and isolation of each tenant. The application database contains the tables that define an application, such as the Object table and other system tables.

    For example, if your current solution contains 10 companies in the Microsoft Dynamics NAV database, you can choose to create separate Microsoft Dynamics NAV databases to store each company’s business data. The knowledge about the shared application is then stored in a dedicated application database. Microsoft Dynamics NAV includes Windows PowerShell cmdlets that create an application database and other cmdlets that enable you to create and administer tenant-specific databases.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Skip to toolbar