Network of MS Dynamics D365, AX, NAV, GP, SL, CRM, RMS, POS professionals › Forums › Microsoft Dynamics NAV / Navision › NAV Installation & Administration › How to upgrade the NAV 2016 database versions to Microsoft Dynamics NAV 2018?
Tagged: Dynamics NAV
July 8, 2019 at 8:06 am #20724
How to upgrade the Microsoft Dynamics NAV 2016 database versions to Microsoft Dynamics NAV 2018?July 9, 2019 at 9:45 am #20907
You use data conversion tools provided with Microsoft Dynamics NAV 2018 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.
Task 1: Prepare the old database
1. Use the Microsoft Dynamics NAV Development Environment that matches the old database to build all application objects.
2. Unlock all application objects.
3. Synchronize the database schema by using the development environment or Dynamics NAV Administration Shell that matches the old 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.
Task 3 Uninstall all V1 extensions in the old database
Open the Microsoft Dynamics NAV Administration Shell that matches to the old database, and run these commands:
1. To get a list of the V1 extensions that are installed, run this command:
Get-NAVAppInfo -ServerInstance -Tenant |ft
Replace with the name of the Microsoft Dynamics NAV Server instance that the database connects to. Replace with the tenant ID of the database. If you do not have a multitenant server instance, use the default.
Make a note of the V1 extensions that you will uninstall because you will reinstall these later after you upgrade the database.
2. For each Extension V1, run this command to uninstall it:
Uninstall-NAVApp -ServerInstance -Name -Version
Replace and with the name and version of the Extension V1 as it appeared in the previous step.
Task 4: Upload the Microsoft Dynamics NAV 2018 license to the old database
By using the Microsoft Dynamics NAV Development Environment that matches the old database, upload the Microsoft Dynamics NAV 2018 license to the database.
Task 5: 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 6: Uninstall (optional) the old product and install the new product
Uninstall the old Dynamics NAV, and then install Microsoft Dynamics NAV 2018.
As a minimum, you must install the following Microsoft Dynamics NAV 2018 components: Client (with the Development Environment), Modern Development Environment, Administration Tools, Server, and SQL Server Components. You can install these components by choosing the Custom option during Setup.
Task 7: Clear Dynamics NAV Server instance and debugger breakpoint records from old database
Clear all records from the dbo.Server Instance and dbo.Debugger Breakpoint tables in the database in SQL Server.
If you did not uninstall the old Dynamics NAV, 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.
Using SQL Server Management Studio, open and clear the dbo.Server Instance and dbo.Debugger Breakpoint tables of the old database. For example, you can run the following SQL query:
DELETE FROM .[dbo].[Server Instance]
DELETE from .[dbo].[Debugger Breakpoint]
Task 8: Convert the old database to the Microsoft Dynamics NAV 2018 format
If the database is on Azure SQL Database, you must first 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 afterward.
To convert the old database to the Microsoft Dynamics NAV 2018 format, open the old database in the Microsoft Dynamics NAV 2018 development environment, and follow the conversion instructions.
Task 9: Import the upgraded application objects and upgrade toolkit objects into the converted database
Using the Microsoft Dynamics NAV 2018 development environment, import the application objects that you want in the Microsoft Dynamics NAV 2018 database. This includes the application objects FOB file (from the application code upgrade) and the upgrade toolkit objects FOB file.
1. Import the application objects FOB file first, and then import the upgrade toolkit FOB file.
2. When you import the FOB file, if you experience metadata conflicts, the Import Worksheet windows appears.
Review the Worksheet page.
Choose Replace All, and then OK to continue.
3. IMPORTANT When prompted about table synchronization, set the Synchronize Schema option to Later.
Task 10: Connect a Microsoft Dynamics NAV 2018 Server instance to the converted database
You use the Microsoft Dynamics NAV Server Administration tool for Microsoft Dynamics NAV 2018 or Set-NAVServerConfiguration cmdlet in the Microsoft Dynamics NAV Administration Shell to connect a Microsoft Dynamics NAV Server instance to the converted database.
The service account that is used by the Microsoft Dynamics NAV Server instance must be a member of the db_owner role in the Dynamics NAV database on SQL Server or Azure SQL Database.
Task 11: Compile all objects that are not already compiled
1. In the development environment, set it to use the Microsoft Dynamics NAV Server instance that connects to the database.
2. 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.
3. (Microsoft Dynamics NAV 2016 and earlier only) 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 that appears, set the **Synchronize Schema** option to **Force**.
> In this step, it is very important that you do not use the **Sync. Schema For All Tables** option from the **Tools** menu.
(Microsoft Dynamics NAV 2016 and earlier only) If the old database includes test runner codeunits, you will get errors on these codeunits that the OnBeforeTestRun and OnAfterTestRun trigger signatures are not valid. To fix these issues, you change the signature of the OnBeforeTestRun and OnAfterTestRun triggers to include the TestPermission parameter.
The triggers for codeunit 130400 CAL Test Runner and 130402 CAL Command Line Test Runner will be updated for you during the data upgrade.
Task 12: Run the schema synchronization on the imported objects
Synchronize the database schema with validation. You can run the schema synchronization from the Microsoft Dynamics NAV Development Environment or Microsoft Dynamics NAV Administration Shell.
Task 13: Run the data upgrade process
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. You can start the data upgrade from the Microsoft Dynamics NAV Development Environment or Microsoft Dynamics NAV Administration Shell.
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 Administration Shell:
Open the Microsoft Dynamics NAV Administration Shell as an administrator, and then run Start-NavDataUpgrade cmdlet as follows:
Start-NavDataUpgrade -ServerInstance -Force
Replace 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 -SkipCompanyInitialization parameter.
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.
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 2018 includes the following client control add-ins.
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 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.
Task 17: Publish and install/upgrade extensions
Microsoft Dynamics NAV 2018 includes several extensions that you publish and install as part of the upgrade process. To enable these extensions, it is important that you follow the steps below.
1. Download the system and test symbols file from the ModernDev folder on the DVD and the application symbols from here. Make a note of the path where you store the files.
3. Publish the platform, test, and application symbols one file at a time to the Dynamics NAV server instance:
Open the Microsoft Dynamics NAV Administration Shell as an administrator, and run the following command for each of the symbol files:
Publish-NAVApp -ServerInstance -Path -PackageType SymbolsOnly
3. Make sure that Enable loading application symbol references at server startup (EnableSymbolLoadingAtServerStartup) are set on the Dynamics NAV server instance.
4. Generate the application symbol references for running Running C/SIDE and AL Side-by-Side:
a) Open a command prompt, change to the directory where the finsql.exe file has been installed as part of Microsoft Dynamics NAV 2018, and then run the following command:
finsql.exe Command=generatesymbolreference, Database=, ServerName=\
Replace values for the Database and ServerName settings to suit.
b) When you run the command, the console returns to an empty command prompt and does not display or provide any indication about the status of the run. However, the finsql.exe may still be running in the background. It can take several minutes for the run to complete, and the symbols will not be generated until such time. You can see whether the finsql.exe is still running by using Task Manager and looking on the Details tab for finsql.exe.
When the process ends, a file named navcommandresult.txt is saved to the Microsoft Dynamics NAV Windows client installation folder. If the command succeeded, the file will contain text like  [06/12/17 14:36:17] The command completed successfully in ‘177’ seconds. If the command failed, another file named naverrorlog.txt will be generated. This file contains details about the error(s) that occurred.
5. Publish all the extensions from the \Extensions folder of the Microsoft Dynamics NAV 2018 installation media (DVD):
a) From the Microsoft Dynamics NAV Administration Shell, run the following command for each extension.
Publish-NAVApp -ServerInstance -Path
V1 extensions have the file type .navx. V2 extensions have the file type .app.
b) For each Extension V2, run the following command to synchronize its schema with the tenant database:
Sync-NAVApp -ServerInstance -Name -Version
6. Upgrade the V1 extensions that you uninstalled previously in Task 3 by reinstalling them. From the Microsoft Dynamics NAV Administration Shell, run the following commands:
a) To get a list of the published extensions on the server instance, run this command:
b) To determine which V1 extensions to install, inspect the list that appears, and compare it with the list that you gathered in Task 3. V1 extensions are indicated by Extension Type: CSIDE.
- If there is only one version of an extension, which matches the version in the old list, then go to step 6c to reinstall the version.
- If there is a newer version of an extension and its Extension Type is also CSIDE, then go to step 6c to install and upgrade to the newer V1 extension.
- If there is a newer version of an extension but its Extension Type is ModernDev, then go to step 6d to upgrade the old V1 extension to the V2 extension.
c) For each V1 Extension that you want to reinstall or upgrade, run this command:
Install-NAVApp -ServerInstance -Name -Version –Tenant
Replace and with the name and version of the Extension V1 as it appeared in the previous step. For , in single-tenant deployments, you either specify default or you omit the –Tenant parameter.
This will upgrade the V1 extensions.
Optionally, if you installed a newer version of an extension, unpublish the old version:
Unpublish-NAVApp -ServerInstance -Name -Version
d) For each V1 Extension that you want to upgrade to a V2 Extension, run these commands:
Sync-NAVApp -ServerInstance -Name -Version
Start-NAVAppDataUpgrade -ServerInstance DynamicsNAV -Name ProswareStuff -Version
This will upgrade the V2 extensions.
Optionally, unpublish the V1 extension.
Unpublish-NAVApp -ServerInstance -Name -Version
7. For the Denmark (DK) local version of Microsoft Dynamics NAV 2018, you must install the following new V2 extensions to get all the local functionality.
Name Publisher Version Payroll Data Import Definitions (DK) Microsoft 1.0.19502.0 (or later) Payment and Reconciliation Formats (DK) Microsoft 1.0.19502.0 (or later) Tax File Formats (DK) Microsoft 1.0.19502.0 (or later)
For each Extension V2, run this command:
8. Recompile published V1 extensions.
Use the Repair-NAVApp cmdlet of the Microsoft Dynamics NAV 2018 Administration Shell to compile the published extensions to make sure they are work with the new platform and application.
For example, you can run the following command to recompile all extensions:
Get-NAVAppInfo -ServerInstance | Repair-NAVApp
Task 18: Update the Dynamics NAV Web client configuration file (navsettings.json)
If you have installed the Microsoft Dynamics NAV Web Server components, populate the navsettings.json file for the Dynamics NAV Web Server instance with the settings of the old web.config file.
ask 19: Delete the upgrade objects
At this point, you have upgraded the database to Microsoft Dynamics NAV 2018. Now, you can delete the upgrade codeunits and upgrade table objects that you imported in task 9. This task is recommended but not required.
When you delete tables, on the Delete dialog box, set the Synchronize Schema option to Force.July 9, 2019 at 3:31 pm #20728
The upgrade process depends on different factors, such as the version of Dynamics NAV that you are upgrading from, and the degree to which your solution differs from the standard version of Dynamics NAV. The mains tasks range from converting the database to upgrading application code and data.
You must be logged in to reply to this topic.