Upgrading from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 to Microsoft Dynamics NAV 2015


Quite a few people have asked that we excavate the guidance for how to upgrade from Microsoft Dynamics NAV 2009 R2 directly to Microsoft Dynamics NAV 2015. We provided this guidance in the blog post for Cumulative Update 1, but as time progresses, this becomes harder to remember and to find. So here you go:

Introduction

This blog post describes the tasks required for upgrading a Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database to Microsoft Dynamics NAV 2015.

Using the upgrade toolkit and conversions tools that are available, the tasks will lead you through the process of converting the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database to Microsoft Dynamics NAV 2013, converting the Microsoft Dynamics NAV 2013 database to Microsoft Dynamics NAV 2015, and finally, converting the old data with the old table and field structure to function together with the table and field structure of Microsoft Dynamics NAV 2015.

In order to use the toolkit to upgrade data, you will also need the Microsoft Dynamics NAV 2013 development environment and Microsoft Dynamics NAV 2015.

Data Upgrade Short Overview

The following lists provides a brief description of the steps involved in the data upgrade. The steps are detailed in the task sections that follow.

  1. In Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, compile all tables.
  2. Make a full SQL backup of the Microsoft Dynamics NAV 2009 R2 database.
  3. Import Microsoft Dynamics NAV 2015 license into the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database.
  4. Import Upgrade601800.[Country].1.fob (use Replace All action on the Import Worksheet).
  5. For each company in the database, run form 104001, Upgrade – Old Version, and choose the Transfer Data action.
  6. Make a full SQL backup of the Microsoft Dynamics NAV 2009 R2 database.
  7. Run form 104001, Upgrade – Old Version, and then choose the Delete Objects action.
  8. Uninstall Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1.
  9. Change the compatibility level of the database by using SQL Server Management. Studio.
  10. Download the latest Cumulative Update of Microsoft Dynamics NAV 2013 and install the Microsoft Dynamics NAV 2013 development environment.
  11. Open the old database with Microsoft Dynamics NAV 2013 development environment and convert the database.
  12. Uninstall Microsoft Dynamics NAV 2013.
  13. Make a full SQL backup of the database.
  14. Install Microsoft Dynamics NAV 2015 including the Development Environment, Microsoft Dynamics NAV Server, and Administration Tool components.
  15. Open the old database with Microsoft Dynamics NAV 2015 Development environment and convert the database.
  16. Make sure the system tables (which have IDs in 2000000004…2000000130 range) are compiled (On the Compile window, set the Synchronize Schema option to Later).
  17. Set database role membership for the service account that is used by the Microsoft Dynamics NAV Server instance to db_owner.
  18. Connect Microsoft Dynamics NAV Server instance to the old database.
  19. Start the development environment as administrator.
  20. Synchronize all tables from the Tools menu by selecting Sync. Schema for All Tables, then With Validation.
  21. Import all new Microsoft Dynamics NAV 2015 objects (use the Replace All action on the Import Worksheet, and then set the Synchronize Schema option to Later).
  22. Import Upgrade601800.[Country].fob.
  23. Compile the tables which are not already compiled (set Synchronize Schema option to Later).
  24. Synchronize all tables from the Tools menu by selecting Sync. Schema for All Tables, then With Validation.
  25. Make a full SQL backup of the database
  26. Run the data upgrade process from the Tools menu by selecting Data Upgrade, and then Start.
  27. Delete obsolete tables and upgrade toolkit objects.
  28. Import updated permissions sets and permissions.
  29. Set language of the database.
  30. Import or register the control add-ins.

Task 1: Run Upgrade Step 1 in the Microsoft Dynamics NAV 2009 R2 or SP1 development environment (Classic client)

  1. Make sure that all table objects have compiled successfully.
    To compile all table objects, in Object Designer, select all objects of type Table, and then on the Tools menu, choose Compile. During compilation, Microsoft Dynamics NAV generates or regenerates the BLOB content in the Object Metadata table that is used in the later steps.
  2. Create a copy or a backup of the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database, and open it in the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 development environment.
  3. Add your Microsoft Dynamics NAV 2015 partner license to the database.
    You can do this by selecting the Save License in Database field in the Alter Database window. If the field was not already selected, a dialog box opens so you can specify the location of your partner license. If the field was already selected, upload the partner license in the License Information window.
  4. Open Object Designer, and then import Upgrade601800.[Country].1.fob from the \UpgradeToolKit\Local Objects folder. In the Import Worksheet window, choose Replace All, and then choose the OK button to import the objects.
  5. For each company in the database, do the following:
  1. Open the company, and make the relevant changes to data. For more information, see Task 3: Data/Object Changes Prior to Step 1 in the MSDN Library.
  2. In Object Designer, run form 104001, Upgrade – Old Version. Choose the Transfer Data button.

    Important: After you have completed this step for all companies, we strongly recommend that you create a full SQL backup the database by using SQL Server management tools.

  • When you have transferred all data for all companies, in the Upgrade – Old Version window, choose the Delete Objects button.
    This action deletes all objects in the database that are not tables, but also obsolete tables that belong to functionality that is not available in Microsoft Dynamics NAV 2015.
  • Task 2: Convert the Microsoft Dynamics NAV 2009 R2 or SP1 database to a Microsoft Dynamics NAV 2013 database

    1. Uninstall Microsoft Dynamics NAV 2009 R2.
    2. Download the latest available Cumulative Update for Microsoft Dynamics NAV 2013.
      The following is article lists the Cumulative Updates that have been released for Microsoft Dynamics NAV 2013: https://mbs2.microsoft.com/Knowledgebase/kbdisplay.aspx?scid=kb,en-us,2842257 
    3. Run the installation program (setup.exe) for Microsoft Dynamics NAV 2013, choose Choose an installation option, choose Custom, and then choose the Client option (with the Development Environment).
    4. Change the compatibility level of the database according to the following:
      For SQL Server 2008 R2 set the compatibility level of the database to 100.
      For SQL Server 2012, set the compatibility level of the database to 110.
      To do this, you use Microsoft SQL Server Management Studio as follows:
    1.  Start Microsoft SQL Server Management Studio and connect to the SQL Server instance that includes the Microsoft Dynamics NAV database.
    2. Right-click the Microsoft Dynamics NAV database, and then select Properties.
    3. In the Database Properties window, choose the Options page, and then set the Compatibility Level to the correct value.
  • In the Microsoft Dynamics NAV 2013 development environment, open the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database and agree to convert the database.
    During this step, Microsoft Dynamics NAV converts all text and code fields to Unicode format by changing their SQL Server data type. This conversion requires more disk space than usual, since both the database and the log file will grow in size considerably. It can also be a lengthy process.
    If your Microsoft Dynamics NAV 2009 R2 database is using SQL Server Collation, within the same step the collation will be changed to a suitable Windows collation. This is because Microsoft Dynamics NAV 2013 and higher versions only support Windows Collation.

    Important: After the database conversion has completed, we strongly recommend that you create a full SQL backup of the database.

  • The technical upgrade of the database to Microsoft Dynamics NAV 2013 is complete. You can now uninstall Microsoft Dynamics NAV 2013.
  • Task 3: Convert the Old Database to a Microsoft Dynamics NAV 2015 Format

    1. Install Microsoft Dynamics NAV 2015.
      During the installation of Microsoft Dynamics NAV 2015, select the Choose an installation option, then select the Custom option, where you choose to install the Client (with the Development Environment), Server, and Administration Tool components.
    2. To convert the old database to a Microsoft Dynamics NAV 2015 format, open the old database in the Microsoft Dynamics NAV 2015 development environment, and then follow the instructions.
    3. After the database conversion is completed, verify that all system tables are compiled.

    System tables have IDs in the range 2000000004 to 2000000130. If any tables are not compiled, then you must compile them. When you compile tables, on the Compile dialog box, set the Synchronize Schema option to Later.

    Task 4: Connect a Microsoft Dynamics NAV 2015 Server Instance to the Converted Database

    1. Using Microsoft SQL Server Management studio, add the service account that is used by the Microsoft Dynamics NAV Server instance (for example, NT AUTHORITY\NETWORK SERVICE) as a member of the db_owner role in the Microsoft Dynamics NAV database on SQL Server.
      For more information, Giving the account necessary database privileges in SQL Server.
    2. Using the Microsoft Dynamics NAV Server Administration tool, connect a Microsoft Dynamics NAV Server instance to the converted database.

    For more information, see How to: Connect a Microsoft Dynamics NAV Server Instance to a Database.

    Task 5: Run Schema Synchronization to initialize the database.

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

    From the development environment:

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

    If synchronization errors occur, run the schema synchronization from Microsoft Dynamics NAV 2015 Administration Shell as described in the following procedure. This enables you to get the complete list of tables that could not be synchronized.

    From the Microsoft Dynamics NAV 2015 Administration Shell:

    1. Open the Microsoft Dynamics NAV 2015 Administration Shell as an administrator.
    2. Run Sync-NavTenant cmdlet as follows:

    Sync-NavTenant –ServerInstance <ServerInstanceName> -Mode Sync

     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 6: Import the Application Objects to the Converted Database

    1. In the development environment, import all the application objects that you want in the Microsoft Dynamics NAV 2015 database.
      When you import the FOB file that contains the Microsoft Dynamics NAV 2015 objects, on the Import Worksheet, choose Replace All, and then choose the OK button to import the objects.
      On the dialog box for selecting the schema synchronization, set the Synchronize Schema option to Later.
    2. After you have imported Microsoft Dynamics NAV 2015 objects, import the upgrade toolkit FOB file Upgrade601800.[Country].fob from \UpgradeToolKit\Local Objects folder.
    3. Compile all objects that have not been compiled yet. On the Compile dialog box, set the Synchronize Schema option to Later.

    Task 7: Run the Schema Synchronization

    Similar to task 5, run the schema synchronization either from the development environment (Tools – Sync. Schema for All Tables – With Validation…) or from Microsoft Dynamics NAV 2015 Administration Shell.

    This will synchronize the data schema changes of the newly imported tables to the SQL tables. It will also run the Upgrade Toolkit Step 1 logic if it is defined in the upgrade codeunit. This step will be performed for all companies in the database, so you don’t have to re-run it for other companies.

    Note: After the schema synchronization has successfully completed, we strongly recommend that you take a full SQL Server backup of the database. 

    Task 8: Run the Data Upgrade to perform Upgrade Toolkit Step 2

    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 2015 Administration Shell.

    From the development environment:

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

    If you want to see the result of running the Data Upgrade action, run the following cmdlet from Microsoft Dynamics NAV 2015 Administration Shell:

    Get-NAVDataUpgrade -ServerInstance <ServerInstanceName> -Detailed | Out-GridView

    In the output of this cmdlet, you can see which upgrade codeunits and functions were run, which companies have been upgraded, the time it took to run each upgrade function, and a detailed description of errors that occurred during the data upgrade.

    If errors occurred while running the data upgrade, you can resolve them directly in the database (for example by updating the upgrade codeunits) and then resume the data upgrade. To resume the data upgrade, on the Tools menu, choose Data Upgrade, and then Resume.

    Note: To optimize upgrade performance and effectively use the available computer resources, the data upgrade functions are executed in parallel and across all companies by default. While performing this step, if you discover that some functions are locking each other from executing, then you can configure the data upgrade to execute data upgrade functions in serial instead of parallel. To do this, on the Start Data Upgrade window, set the Execution Mode option to Serial. For more information see http://msdn.microsoft.com/en-us/library/dn762348(v=nav.80).aspx.

    From the Microsoft Dynamics NAV 2015 Administration Shell:

    Open the Microsoft Dynamics NAV 2015 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 as follows:

    Get-NAVDataUpgrade -ServerInstance <ServerInstanceName> -Progress

    Note: 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.

    Task 9: Delete the Upgrade Objects and Obsolete Tables

    At this point, you have upgraded the database to Microsoft Dynamics NAV 2015. Now, you can delete the tables which are not needed into the new application, plus the upgrade codeunits and upgrade table objects that you imported in task 6.

    For application tables, you can see which the tables are marked for deletion in the Version List column in the Tables list of Object Designer. During the data upgrade that you performed in task 8, these tables were marked with the text Old Unused Table – marked for deletion. Upgrade objects are marked with the text Upgrade Toolkit Object – marked for deletion.

    When you delete tables, if you don’t need the data that is saved in the tables, then on the Delete dialog box, set the Synchronize Schema option to Force.

    Task 10: 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 11: 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 12: 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 2015. 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.MicrosoftDynamicsOnlineConnectControl
    • Microsoft.Dynamics.Nav.Client.BusinessChart
    • Microsoft.Dynamics.Nav.Client.PageReady
    • Microsoft.Dynamics.Nav.Client.PingPong
    • Microsoft.Dynamics.Nav.Client.VideoPlayer
    • Interactive Timeline Visualization Add-in

    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.

    Comments (16)

    1. stryk says:

      What should be highlighted: Task 2, Step 5:

      "During this step, Microsoft Dynamics NAV converts all text and code fields to Unicode format by changing their SQL Server data type. This conversion requires more disk space than usual, since both the database and the log file will grow in size considerably. It can also be a lengthy process."

      I had cases where the database grew for about 30% and the log was more than 20 times the size of the database! Be careful! I.E. converting a 350GB db broke down after the log was more than 6 TerraBytes (!!!) and the disk was full …

      To reduce the load during such a conversion, you might add these steps:

      Before Step 5:

      • Export all table objects into FOB/TXT
      • Set MaintainSQLIndex to FALSE for all Keys, except PK and Clustered Index (at least this should be done for the largest tables)

      • Set MaintainSIFTIndex to FALSE for all Keys (at least this should be done for the largest tables)

      This would reduce the number of Indexes and VSIFT to convert, thus, reducing the workload and growth.

      Then run the Unicode conversion; Step 5

      After Step 5:

      • Import tables (maybe each single one separately) from FOB/TXT and compile

      This would re-create the Indexes and VSIFT; but as you could do this step-by-step the workload could be split into smaller "Batches", avoiding super-growth of the log file!

      Referring to my example from above, with tweaking like this the log grew "only" to about 2+ TB …

      (Plan B might be to convert some huge tables via SQL Scripts, not NAV)

    2. Brandon Weber says:

      Only thing I'm finding is the dimension sets are not being generated and the new dimension set entry is not being populated.  Am I missing something??

    3. Pallea says:

      @Jörg

      I totally agree. Disable all keys that are not necessary! Besides from disc-space the update also becomes much faster.

      20 times the size, wow…My experience is 6-8times the size.

      /Palle

    4. Pallea says:

      @Brandon Weber You must be doing something very wrong and NOT following the text directly, Upgrade step 2 should do the trick!

      I have done more than 20 upgrades from 2009 to 2013 R2/2015 without any problems regarding the Dimenion Sets.

      Thanks

      Palle

    5. Pallea says:

      One more thing @Jörg

      Did you read this one ?

      sqlperformance.com/…/delayed-durability-in-sql-server-2014

      That might speed it up and make a smaller log-file.

      /Palle

    6. Brandon Weber says:

      I figured out my issue.  It works, just a dumb power shell mistake on my end.

    7. Madan MK says:

      Will it work without any errors?

    8. Lars Westman says:

      Does step 2 still rename all users to include the domain name?

      I did a 2013R2 upgrade a few months ago with 60 users and saved a lot of time by doing that with an SQL-script instead (larswestman.se/speeding-up-step-2-in-nav-upgrades).

    9. Jason Wilder says:

      Thanks for this it is a huge help.  A couple of comments:

      1) For those of us that use the NAV CRM Connector there is a performance issue that can be addressed.  There are certain tables that sync with CRM (Customer, Items, Sales Lines and Sales Invoices) and when the upgrade toolkit does a modifyall on these tables it takes a long time because the OnDatabaseModify trigger gets called for each modify.  My suggestion is to turn the integration off (In Marketing Setup make "Enable Connector" false and make sure to close out and go back in or just comment out Codeunit 1 OnDatabaseModify Function.)

      2) I am finding that step 3 (Import NAV 2015 license) does not work here.  That step needs to be moved down to when you are actually using the NAV 2015 executables (somewhere around step 15).

    10. Jason Wilder says:

      Quick correction to  my last post:  

      Commenting out Code in Codeunit 1 does not solve the slowness.  So go with the unclicking of "Enable Connector" in Marketing Setup instead.  It shaved off 2 hours in our database but that is because we have over 1 million customers.

    11. bho_NAV says:

      What's a good guideline on how much time it should take to complete the entire upgrade process?

      Thanks.

    12. Alex says:

      Hi all,

      I have a question related to the Upgrade601800.[Country].fob file.

      I downloaded Dynamics.80.NA.1538476.DVD.zip NAV installation package from Partner Source and didn't find mentioned file from the UpgradeToolKitLocal Objects folder.

      Where it can be found?

      Thank you in advance!

      PS:

      there are only two files are present in the UpgradeToolKitLocal Objects folder:

      – Upgrade710800.US.fob

      – Upgrade700800.US.fob

      Same for UpgradeToolKitData Conversion Tools folder – mentioned file is not present.

      1. Luc van Vugt says:

        It was not a straight forward exercise to find the .fob to do the “Upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 to Microsoft Dynamics NAV 2015”.But I found it to be residing on each CU of NAV 20015.

    13. navteam says:

      Hi Alex,

      We're investigating the issue with the missing .fob files for upgrading from Dynamics NAV 2009 SP1 in the NA build you are referring to. We fully expect the upcoming cumulative update to include the missing files. We apologize for the confusion and the delay.

    14. Colin Kee says:

      Hi, I am sorry that I have to post a comment here. I tried using Dynamics NAV Community, but there was no reply to this question. We have staffs who are serving two departments and thus have two approving managers. What is the best practice for a staff serving two departments in NAV 2015? Thank you.

    15. Laura says:

      At the step 4 of the Task 1 you import Upgrade601800.[Country].1.fob . and then replace all the objects.
      But I have a doubt I should EXPORT the objects for then do the import at the task 6?
      when I should do the merge and the export? I don’t understand that!
      Thanks.