Aracılığıyla paylaş


Upgrading the Data

This topic describes the tasks required for upgrading a Microsoft Dynamics NAV 2013, Microsoft Dynamics NAV 2013 R2, or Microsoft Dynamics NAV 2015 database to Microsoft Dynamics NAV 2016.

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

  • Prerequisites

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

  • Task 2: Upload the Microsoft Dynamics NAV 2016 license to the old database

  • Task 3: Delete all objects from the old database

  • Task 4: Uninstall the old product and install the new product

  • Task 5: Convert the old database to a Microsoft Dynamics NAV 2016 format

  • Task 6: Connect a Microsoft Dynamics NAV 2016 Server instance to the converted database

  • Task 7: Run the schema synchronization to complete the database conversion

  • Task 8: Import the application objects to the converted database

  • Task 9: Run the schema synchronization to synchronize the new tables

  • Task 10: Run the data upgrade process

  • Task 11: Delete the upgrade objects

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

  • Task 13: Set the language of the customer database

  • Task 14: Add new control add-ins

  • Task 15: Import Payment Services and Data Encryption Key (Optional)

Important

During the data upgrade, you must make sure that your computer uses the same codepage as the data. When you use conflicting codepages, some characters will not display in captions, and you might not be able to access the upgraded database. Optionally, you can export the captions before the upgrade. For more information, see How to: Add Translated Strings for Conflicting Text Encoding Formats.

If you upgrade a database using a different codepage, Microsoft Dynamics NAV must remove incorrect metadata characters to complete the data upgrade. Then, 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.

Prerequisites

  • 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, see Upgrading the Application Code.

  • All application objects in the old database have been built.

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

  • All application objects are unlocked.

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

  • The database schema has been synchronized in the old application.

    For more information, see How to: Run the Sync-NAVTenant Cmdlet to Synchronize the Tenant Database with the Application Database.

  • All Microsoft Dynamics NAV Server instance records have been cleared from the dbo.Server Instance table in the old database in SQL Server.

    You can do this by using SQL Server Management Studio to open and clear the table.

  • Updated permission sets permissions XML files.

  • (Optional) If the old Microsoft Dynamics NAV application uses Payment Services for Microsoft Dynamics ERP, download the encryption key file that is used on the service connection.

    You can download the encryption from the Microsoft Dynamics ERP Payment Services Connection Setup window in the Microsoft Dynamics NAV client. For more information, see Microsoft Dynamics ERP Payment Services Connection Setup

  • (Optional) If the old Microsoft Dynamics NAV application uses data encryption, export the encryption key file that it used for the data encryption.

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

Task 1: 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 2: Upload the Microsoft Dynamics NAV 2016 license to the old database

By using the Microsoft Dynamics NAV Development Environment that matches the old database, upload the Microsoft Dynamics NAV 2016 license to the database. For more information, see Uploading a License File for a Specific Database.

Task 3: Delete all objects from the old database

In the development environment version that matches the database, open the old database, open Object Designer, and then delete all objects.

Task 4: Uninstall the old product and install the new product

Uninstall Microsoft Dynamics NAV 2013, Microsoft Dynamics NAV 2013 R2, or Microsoft Dynamics NAV 2015, and then install Microsoft Dynamics NAV 2016.

During installation of Microsoft Dynamics NAV 2016, 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 5: Convert the old database to a Microsoft Dynamics NAV 2016 format

To convert the old database to a Microsoft Dynamics NAV 2016 format, open the old database in the development environment, and follow the conversion instructions.

Task 6: Connect a Microsoft Dynamics NAV 2016 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 Microsoft 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 7: Run the schema synchronization to complete the database conversion

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

From the development environment:

Open development environment as an administrator. On the Tools menu, choose Sync. Schema For All Tables, and then choose With Validation and follow the schema synchronization instructions.

From the Microsoft Dynamics NAV 2016 Administration Shell:

Open the Microsoft Dynamics NAV 2016 Administration Shell as an administrator, and then run Sync-NavTenant cmdlet as follows:

Sync-NavTenant –ServerInstance <ServerInstanceName>

Replace <ServerInstanceName> with the name of the Microsoft Dynamics NAV Server instance that is connected to the database. For more information, see How to: Run the Sync-NAVTenant Cmdlet to Synchronize the Tenant Database with the Application Database.

Task 8: Import the application objects to the converted database

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

When you import the FOB file, if you experience metadata conflicts, use the Import Worksheet to handle these conflicts.

Finally, on the dialog box for selecting the schema synchronization, set the Synchronize Schema option to Later.

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.

Task 9: Run the schema synchronization to synchronize the new tables

Similar to task 7, to publish the data schema changes of the newly imported tables to the SQL tables, run the Sync. Schema For All Tables – With Validation option from the development environment or run the Sync-NavTenant cmdlet from the Microsoft Dynamics NAV 2016 Administration Shell.

Task 10: 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 2016 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.

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 2016 Administration Shell:

Open the Microsoft Dynamics NAV 2016 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 11: Delete the upgrade objects

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

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

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

You import the permission sets and permissions XML files according to the following procedure.

To import the permission sets and permissions

  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 Import/Export Permission Sets to import the permission sets XML file,

    In the request page for the XMLport, in the Direction field, choose Import, choose the OK button, and then specify the permission sets XML file.

  3. Run XMLport 9172 Import/Export Permissions to import the permission XML file.

    In the request page for the XMLport, in the Direction field, choose Import, choose the OK button, and then specify the permissions XML file.

Task 13: 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 14: Add new control add-ins

The database is now fully upgraded and is ready for use. However, you may want to add the new client control add-ins that are included in Microsoft Dynamics NAV 2016. These are not added by the upgrade process. The following client control add-ins are available from the Microsoft Dynamics NAV product media:

  • Microsoft.Dynamics.Nav.Client.BusinessChart

  • Microsoft.Dynamics.Nav.Client.PageReady

  • Microsoft.Dynamics.Nav.Client.PingPong

  • Microsoft.Dynamics.Nav.Client.VideoPlayer

  • Microsoft.Dynamics.Nav.Client.SocialListening

You can add control add-ins in the Control Add-ins window in the Microsoft Dynamics NAV Windows client. For more information, see How to: Register a Windows Client Control Add-in.

Task 15: Import Payment Services and Data Encryption Key (Optional)

  • If you want to set up Payment Services for Microsoft Dynamics ERP as before, you must upload the payment service encryption key file that was downloaded previously.

    You upload the encryption key from the Microsoft Dynamics ERP Payment Services Connection Setup window in the Microsoft Dynamics NAV client. For more information, see Microsoft Dynamics ERP Payment Services Connection Setup.

  • If you want to use data encryption as before, you must import the data encryption key file that was exported previously.

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

See Also

Concepts

Upgrading the Application Code
Automating the Upgrade Process using Sample Windows PowerShell Scripts
Synchronizing Table Schemas

Other Resources

Upgrading to Microsoft Dynamics NAV 2016