Freigeben über


Upgrading the Data to Dynamics NAV 2017

Applies to: Microsoft Dynamics NAV 2017. See Microsoft Dynamics NAV 2018 version.

This topic describes the tasks required for upgrading the following database versions to Microsoft Dynamics NAV 2017:

  • Microsoft Dynamics NAV 2013
  • Microsoft Dynamics NAV 2013 R2
  • Microsoft Dynamics NAV 2015
  • Microsoft Dynamics NAV 2016

You use data conversion tools provided with Microsoft Dynamics NAV 2017 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.

The data upgrade process described in this article leads you through the database conversion (technical upgrade) and then the upgrade of the actual data, which is achieved by using the upgrade toolkit/upgrade codeunits.

Prerequisites

Before you start the upgrade tasks, make sure you meet 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 Microsoft Dynamics NAV 2017 must remove incorrect metadata characters to complete the data upgrade. In this case, after 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.

    Optionally, you can export the captions before the upgrade. For more information, see How to: Add Translated Strings for Conflicting Text Encoding Formats.

  2. You have a FOB file that contains the upgraded application code and upgrade toolkit. The upgrade toolkit can also be in a separate FOB file.

    For more information about upgrading the application code, see Upgrading the Application Code.

    You can find the default upgrade toolkit objects in the UpgradeToolKit\Data Conversion Tools folder on the Microsoft Dynamics NAV 2017 installation media (DVD). Choose the FOB that matches the Dynamics NAV version from which you are upgrading:

    Version FOB Remarks
    Microsoft Dynamics NAV 2013 Upgrade7001100.FOB This file can be found on the Microsoft Dynamics NAV 2017 Cumulative Update 15 installation media (DVD). It is not available with later cumulative updates.
    Microsoft Dynamics NAV 2013 R2 Upgrade7101100.FOB and Upgrade710HF1100.FOB This file can be found on the Microsoft Dynamics NAV 2017 Cumulative Update 15 installation media (DVD). It is not available with later cumulative updates.
    Microsoft Dynamics NAV 2015 Upgrade8001100.FOB
    Microsoft Dynamics NAV 2016 Upgrade9001100.FOB
  3. You have exported the permission sets and permissions as XML files.

    For more information, see How to: Export and Import Permission Sets and Permissions.

  4. (Optional) If the old Dynamics NAV application uses data encryption, you exported the encryption key file that it used for the data encryption.

    For more information, see How to: Export and Import Encryption Keys.

Note

If the old Microsoft Dynamics NAV application uses Payment Services for Microsoft Dynamics ERP, be aware that this is discontinued in Microsoft Dynamics NAV 2017. This means that most of the objects that are associated with this feature will be deleted during the upgrade. Some objects you will have to manually delete.

Task 1: Prepare the old database

  1. Use the Microsoft Dynamics NAV Development Environment that matches the old database to build all application objects.

    For more information, see How to: Build Server Application Objects.

  2. Unlock all application objects.

    For more information, see How to: Unlock an Object.

  3. Synchronize the database schema by using the development environment or Dynamics NAV Administration Shell that matches the old database.

    For more information, see How to: Synchronize the Tenant Database with the Application Database.

Task 2: Create a full SQL backup of the old database on SQL Server

You must 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.

For more information, see Create a Full Database Backup (SQL Server).

Task 3: Upload the Microsoft Dynamics NAV 2017 license to the old database

By using the Microsoft Dynamics NAV Development Environment that matches the old database, upload the Microsoft Dynamics NAV 2017 license to the database.

For more information, see Uploading a License File for a Specific Database.

Task 4: Delete all objects except tables from the old database

In the development environment version that matches the database, open the old database, open Object Designer, select all objects except tables, and then choose Delete.

You can also use the DeleteObjects command of the finsql.exe.

Task 5: Uninstall the old product and install the new product (Optional)

Uninstall the old Dynamics NAV, and then install Microsoft Dynamics NAV 2017.

During installation of Microsoft Dynamics NAV 2017, you can either choose the Install Demo option, for which you will discard the Demo database afterwards, or choose the Custom option, where you then select to install the Client (with the Development Environment), Server, and Administration Tool components.

Task 6: Clear Dynamics NAV Server instance records from old database

Clear all Microsoft Dynamics NAV Server instance records from the dbo.Server Instance table in the database in SQL Server.

  1. Make sure that you stop the old Microsoft Dynamics NAV Server instance, and close any tools that connect to the database, such as the Dynamics NAV Administration Tool and development environment.
  2. Using SQL Server Management Studio, open and clear the dbo.Server Instance table of the old database. For example, you can run the following SQL query:
    DELETE FROM [My NAV Database Name].[dbo].[Server Instance]
    

Task 7: Convert the old database to the Microsoft Dynamics NAV 2017 format

To convert the old database to the Microsoft Dynamics NAV 2017 format, run the Microsoft Dynamics NAV 2017 development environment as an administrator, open the old database, and follow the conversion instructions.

If you do not run the development environment as an administrator, you will get an error and the conversion will be stopped.

Important

Do not run schema synchronization at this time.

Task 8: Import the application objects to the converted database and compile

In the development environment, import all the application objects that you want in the Microsoft Dynamics NAV 2017 database. This includes the FOB file that contains all the Microsoft Dynamics NAV 2017 objects from the application code upgrade and upgrade toolkit objects.

  1. If the upgrade toolkit objects are stored in a separate FOB file, then import the upgrade toolkit FOB file after the application objects are imported. For more information, see How to: Import Objects.

  2. When you import the FOB file, if you experience metadata conflicts, the Import Worksheet windows appears. Use this window to handle these conflicts. For more information, see Import Worksheet.

  3. When prompted, set the Synchronize Schema option to Later.

Task 9: Connect a Microsoft Dynamics NAV 2017 Server instance to the converted database

You use the Microsoft Dynamics NAV Server Administration tool to connect a Microsoft Dynamics NAV Server instance to the converted database.

In addition, you must add the service account that is used by the Microsoft Dynamics NAV Server instance as a member of the db_owner role in the Dynamics NAV database on SQL Server.

Important

When upgrading a large database, you should increase the SQL Command Timeout setting for the Microsoft Dynamics NAV Server instance, to avoid timeouts during schema synchronization. The default setting is 30 minutes.

For more information, see How to: Connect a Microsoft Dynamics NAV Server Instance to a Database and Giving the account necessary database privileges in SQL Server.

Task 10: Compile all objects that are not already compiled

Use the development environment or finsql.exe to compile all objects that are not already compiled. This includes the imported application objects, data tables, and system tables. Choose to run schema synchronization later.

For example, in Object Designer, choose Tools, choose Compile, set the Synchronize Schema option to Later, and then choose OK. For more information, see Compiling Objects.

If you get errors on the following table objects, use the Object Designer to delete the objects because they are no longer used.

  • Table 470 Job Queue (replaced by the Task Scheduler)
  • Table 824 DO Payment Connection Details
  • Table 825 DO Payment Connection Setup
  • Table 827 DO Payment Credit Card
  • Table 828 DO Payment Credit Card Number
  • Table 829 DO Payment Trans. Log Entry
  • Table 1510 Notification Template

When you delete a table object, in the Delete confirmation dialog box, set the Synchronize Schema option to Force. At this point, it is very important that you do not use the Sync. Schema For All Tables option from the Tools menu.

Task 11: Run the schema synchronization on the imported objects

You can run the schema synchronization from the Microsoft Dynamics NAV Development Environment or Microsoft Dynamics NAV Administration Shell.

For more information, see How to: Synchronize the Tenant Database with the Application Database.

Task 12: Run the data upgrade process

A data upgrade runs the upgrade toolkit objects, such as upgrade codeunits and upgrade tables, to migrate business data from the old table structure to the new table structure. You can start the data upgrade from the Microsoft Dynamics NAV Development Environment or Microsoft Dynamics NAV Administration Shell.

Note

In the last phase of data upgrade, all companies will be initialized by running codeunit 2 Company Initialization. This is done automatically. If you want to skip company initialization, then use the Start-NavDataUpgrade cmdlet and set the -SkipCompanyIntitialization parameter.

From the development environment:

Open development environment as an administrator. On the Tools menu, choose Data Upgrade, and then choose Start and follow the instructions.

If you do not run the development environment as an administrator, you will get an error and the data upgrade will be stopped.

To view the progress of the data upgrade, on the Tools menu, choose Data Upgrade, and then choose Show Progress.

From the Microsoft Dynamics NAV Administration Shell:

Open the Microsoft Dynamics NAV Administration Shell as an administrator, and then run Start-NavDataUpgrade cmdlet as follows:

Start-NavDataUpgrade -ServerInstance <ServerInstanceName> -Force  

Replace <ServerInstanceName> with the name of the Microsoft Dynamics NAV Server instance that is connected to the database.

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.

Task 13: Delete the upgrade objects

At this point, you have upgraded the database to Microsoft Dynamics NAV 2017. Now, you can delete the upgrade codeunits and upgrade table objects that you imported in task 9.

When you delete tables, on the Delete dialog box, set the Synchronize Schema option to Force.

Task 14: Import upgraded permission sets and permissions by using the Roles and Permissions XMLports

You import the permission sets and permissions XML files.

  1. Delete all permission sets in the database except the SUPER permission set.

    In Object Designer, run page 9802 Permission Sets, and then delete the permission sets.

  2. Run XMLport 9171 and XMLport 9172 to import the permission sets and permission XML files.

    For more information, see How to: Export and Import Permission Sets and Permissions.

Task 15: Set the language of the customer database

In the development environment, choose Tools, choose Language, and then select the language of the original customer database.

Task 16: Register client control add-ins

The database is now fully upgraded and is ready for use. However, Microsoft Dynamics NAV 2017 includes the following client control add-ins.

  • Microsoft.Dynamics.Nav.Client.BusinessChart
  • Microsoft.Dynamics.Nav.Client.CodeViewer
  • Microsoft.Dynamics.Nav.Client.DynamicsOnlineConnect
  • Microsoft.Dynamics.Nav.Client.OAuthIntegration
  • Microsoft.Dynamics.Nav.Client.PageReady
  • Microsoft.Dynamics.Nav.Client.PingPong
  • Microsoft.Dynamics.Nav.Client.SocialListening
  • Microsoft.Dynamics.Nav.Client.TimelineVisualization
  • Microsoft.Dynamics.Nav.Client.VideoPlayer
  • Microsoft.Dynamics.Nav.Client.WebPageViewer

To use these add-ins, they must be registered in table 2000000069 Client Add-in. Depending on the version that you upgraded from, all the add-ins might not be registered after the upgrade process. You can register missing control add-ins in the Control Add-ins page in the Microsoft Dynamics NAV Windows client. The assemblies (.dlls) for these add-ins are located in subfolders to the Add-ins folder of the Dynamics NAV Server installation, which by default is C:\Program Files\Microsoft Dynamics NAV\110\Service\Add-ins. For more information, see How to: Register a Windows Client Control Add-in.

See Also

Upgrading the Application Code
Automating the Upgrade Process using Sample Windows PowerShell Scripts
Synchronizing Table Schemas
Upgrading to Microsoft Dynamics NAV 2017