Upgrading the Data
When you have upgraded the application code, you can start upgrading the data.
For the Microsoft Dynamics NAV database upgrade, you convert the existing data with the table and field structure in the old version, so that it functions together with the new version’s table and field structure. You use the same overall process for upgrading data from Microsoft Dynamics NAV 2013, Microsoft Dynamics NAV 2009 R2, and from Microsoft Dynamics NAV 2009 SP1.
The following list describes the main steps of upgrading the data:
Prepare the data for the upgrade
Step 1 covers tasks that involve the existing data in the objects from Microsoft Dynamics NAV 2013. You perform Step 1 tasks using the Microsoft Dynamics NAV 2013 database that has been converted by using the Microsoft Dynamics NAV 2013 R2 development environment.
However, if you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you carry out step 1 in the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 Classic client.
Upgrading the data to Microsoft Dynamics NAV 2013 R2
Step 2 covers tasks that involve changes to the existing data with the new version objects. You perform Step 2 tasks using the Microsoft Dynamics NAV 2013 R2 development environment.
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.
Step 1: Prepare the existing data for the upgrade
The tasks in this part of the upgrade process involve upgrading the customer’s database to Microsoft Dynamics NAV 2013 R2. The tasks are different if you only want to upgrade data, or if you are upgrading an existing solution, including upgrading the application code. Also, if you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you must carry out step 1 in the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 Classic client. Then, you open the same database in the Microsoft Dynamics NAV 2013 development environment to convert the database. Finally, you carry out step 2 in the Microsoft Dynamics NAV 2013 R2 development environment.
Task 1: Open the customer’s existing database in the relevant development environment
If you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you open customer's database in the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 Classic client.
If you upgrade from Microsoft Dynamics NAV 2013, you open the customer's database in the Microsoft Dynamics NAV 2013 R2 development environment. Follow the steps that are described in Converting a Microsoft Dynamics NAV 2013 Database.
In both scenarios, you must import your partner license into 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 from the License Information window.
Task 2: Import the objects for upgrade step 1
The objects that are included in the .fob file for upgrade step 1 are used during the conversion of the existing data to the new database schema. If you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you must import the Upgrade601701.1.fob file from the 601 folder. If you upgrade from Microsoft Dynamics NAV 2013, you must import the Upgrade700701.1.fob file from the 701 folder.
Important
When you upgrade a country-specific version, you must import the FOB file from the …\UpgradeToolKit\Local Objects folder. For example, if you are upgrading the Danish version of Microsoft Dynamics NAV 2013, the name of the file is Upgrade700701.DK.1.fob.
Otherwise, import the fob file from the ..\UpgradeToolKit\Data Conversion Tools\701 folder on the Microsoft Dynamics NAV 2013 R2 product media.
You will receive a message that the client cannot import the objects because there are objects already in the database with conflicting versions. Choose the OK button and then, in the Import Worksheet dialog box, choose Replace All.
Task 3: Data/Object changes before step 1
For each company in the database, open the company, and make the relevant changes to data. If you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, see Task 3: Data/Object Changes Prior to Step 1. If you upgrade from Microsoft Dynamics NAV 2013, make sure that there are no entries in the Item table where the Replenishment System field is set to None.
Important
In Microsoft Dynamics NAV 2013 R2, you can only change the company in the Microsoft Dynamics NAV Windows client. The Microsoft Dynamics NAV 2013 R2 development environment will run all objects in the context of the company that you last opened in the Microsoft Dynamics NAV Windows client.
Task 4: Data conversion
To perform the step 1 data conversion, follow these steps for each company in the database.
To perform step 1 data conversion
In the development environment, open Object Designer, and then select page 104001 Upgrade – Old Version.
Choose Run. This opens the page in the Microsoft Dynamics NAV Windows client.
Alternatively, if you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, run form 104001 instead.
Choose Transfer Data.
This runs codeunit 104045, which starts the process of moving the data to the new database scheme.
If any of the upgrade preconditions are not met, the Upgrade Error Log window will appear and list the errors. To correct any errors that may occur, select the error in the Upgrade Error Log window and choose Show. This will open the relevant page and, where it is possible, show the specific record with the error. Microsoft Dynamics NAV stores the last successfully processed table in the State Indicator table. You can see the status of the upgrade process in the Upgrade – Old Version window.
Repeat this procedure for each company in the database.
If you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you must now delete the upgrade toolkit objects. For more information, see
When you choose the Delete Objects action, codeunit 104002 Delete Old Objects deletes all objects that are not tables.
If you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you can now close the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 development environment. In the remaining part of the data upgrade, you use Microsoft Dynamics NAV 2013 and Microsoft Dynamics NAV 2013 R2. However, before you continue, you must change the compatibility level of your database. For SQL Server 2008 and SQL Server 2008 R2, verify that the compatibility level of the database is set to 100. For SQL Server 2012, set the compatibility level to 110.
Next, you must open the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database in the Microsoft Dynamics NAV 2013 development environment and agree to convert the database. The following procedure only applies if you are upgrading data from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1. If you upgrade from Microsoft Dynamics NAV 2013, continue to the next procedure.
To convert the Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 database to Microsoft Dynamics NAV 2013
Open 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.
The database has now been technically upgraded to Microsoft Dynamics NAV 2013. For more information, see Task 6: Create the New Microsoft Dynamics NAV Database. Next, you convert the database to Microsoft Dynamics NAV 2013 R2.
To convert the database to Microsoft Dynamics NAV 2013 R2
Open the Microsoft Dynamics NAV 2013 R2 development environment.
Open the database that you converted to Microsoft Dynamics NAV 2013 and agree to convert the database.
This includes an upgrade of system tables, and an upgrade of all reports to support Report Viewer 2010.
After database conversion has completed, you will receive compilation errors in several standard Microsoft Dynamics NAV objects. You must resolve these errors before you continue. For more information, see Converting a Microsoft Dynamics NAV 2013 Database. If you see errors about reports that are specific to this database, you must modify the objects in the original Microsoft Dynamics NAV 2013 database and then start the conversion again.
Compile the system tables. You can find the tables by setting a filter for table ID 2000000004..2000000130.
In the following step, you will be connecting a Microsoft Dynamics NAV Server instance to the database.
Make sure that the service account that the Microsoft Dynamics NAV Server instance uses has the db_owner role for the database. Connect the Microsoft Dynamics NAV Server instance to the database, and then start the service instance. For more information, see How to: Change the Microsoft Dynamics NAV Server Instance.
In the Microsoft Dynamics NAV 2013 R2 development environment, on the Tools menu, choose Options, and then make sure that the configuration of the Microsoft Dynamics NAV Server connection is set up as described in the following table.
Field Description Prevent data loss from table changes
Specifies if you receive a warning message if you compile an object that will result in data loss
ImportantMake sure the field is set to Yes.Server Name
Specifies the server that hosts the Microsoft Dynamics NAV Server instance, such as MyServer.
Server Instance
Specifies the Microsoft Dynamics NAV Server instance that is being used, such as DYNAMICSNAV71.
Server Port
Specifies the port on the server that hosts the Microsoft Dynamics NAV Server instance, such as 7046.
This ensures that the Microsoft Dynamics NAV Server instance that is connected to the database will verify that no operation will cause loss of data in the development environment.
Task 5: Export permission sets and permissions
Optionally, you can preserve existing permissions sets and permissions by exporting them from the database before you continue the upgrade.
To export permission sets and permissions
In the Upgrade – Old Version window, choose Export Roles.
This runs XMLport 104001 Import/Export Roles, which exports all permission sets to an XML file.
In the request page for the XMLport, in the Direction field, choose Export, and then choose the OK button. Specify the location where you want to save the XML file, and save it as PermissionSets.xml.
In the Upgrade – Old Version window, choose Export Permissions.
This runs XMLport 104002 Import/Export Permissions, which exports all permissions to an XML file.
In the request page for the XMLport, in the Direction field, choose Export, and then choose the OK button. Specify the location where you want to save the XML file, and save it as Permissions.xml.
Task 6: Delete objects
After task 4, the Delete Objects actions is made available in the Upgrade – Old Version window. If you are upgrading from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you already deleted the objects. If you are upgrading from Microsoft Dynamics NAV 2013, you must delete the objects now.
You must delete all objects in the database that are not tables. This task also deletes tables that belong to features that are not available in Microsoft Dynamics NAV 2013 R2.
When you choose the Delete Objects action, codeunit 104002 Delete Old Objects deletes all objects that are not tables.
In task 7, you replace these objects with the customized objects that you created as part of the merge process.
Task 7: Import all customized objects
Earlier in the upgrade process, you created a FOB file with customized Microsoft Dynamics NAV 2013 R2 objects, objects.fob. This FOB file contains all Microsoft Dynamics NAV 2013 R2 objects with your existing customizations applied. For more information, see Upgrading the Application Code.
Now, you can import those objects into the Microsoft Dynamics NAV 2013 R2 database. When the import starts, a warning appears that some objects with conflicting versions already exist in the database, or that no such conflict exists. Choose the OK button to open the Import Worksheet. Then, choose the Replace All button, and then choose the OK button to import the objects.
If any errors occur, you must correct the issues in the original, customized database, export the objects, and then repeat task 7.
Task 8: Compile the imported objects
When you have imported the customized objects, you must compile all objects.
Warning
If you receive complication errors for the customized objects, you must correct the issues and compile the objects before you move on to task 9.
This completes step 1 of the data upgrade.
Step 2: Upgrading the Data to Microsoft Dynamics NAV 2013 R2
Step 2 of the data upgrade involves changes to the existing data with the new version objects. You perform Step 2 tasks using the Microsoft Dynamics NAV 2013 R2 development environment.
Task 9: Import the objects for upgrade step 2
You must import the objects that are needed for step 2 of the data upgrade. If you upgrade from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1, you must import the Upgrade601701.2.fob file from the 601 folder. If you upgrade from Microsoft Dynamics NAV 2013, you must import the Upgrade700701.2.fob file from the 701 folder.
Important
When you upgrade a country-specific version, you must import the FOB file from the …\UpgradeToolKit\Local Objects folder. For example, if you are upgrading the Danish version of Microsoft Dynamics NAV 2013, the name of the file is Upgrade700701.DK.2.fob.
Otherwise, import the fob file from the ..\UpgradeToolKit\Data Conversion Tools\701 folder on the Microsoft Dynamics NAV 2013 R2 product media.
You will receive a message that the client cannot import the objects because there are objects already in the database with conflicting versions. Choose the OK button and then, in the Import Worksheet dialog box, choose Replace All.
Task 10: Data/Object changes before step 2
Before you perform step 2, you must make sure that the right language is set.
In the Microsoft Dynamics NAV 2013 R2 development environment, choose Tools, choose Language, and then select the language of the original customer database.
Task 11: Step 2 – Data conversion
The data conversion is company-specific, so you must repeat the following procedure for all companies in the database.
To convert data for a company
Open the Microsoft Dynamics NAV Windows client, choose the company that you want to upgrade, and then close Microsoft Dynamics NAV Windows client.
In the Microsoft Dynamics NAV 2013 R2 development environment, open Object Designer, and then select page 104002 Upgrade – New Version.
Choose Run. This opens the page in the Microsoft Dynamics NAV Windows client.
If you imported upgrade objects from the Upgrade601701.2.fob file, to make sure that the relevant C/AL code has access to the database, choose Test Database Connection.
Important
If your configuration is based on a named SQL Server instance, you must open the window in edit mode and then specify the name in the SQL Server Name field.
In the Upgrade – New Version window, choose Transfer Data.
This runs codeunit 104048, Upgrade New Version. The codeunit does the following:
Customer and vendor ledger entry numbers are added to sales and purchase tables to determine if the related sales and purchase invoices are paid.
A Cust. Ledger Entry No. field is added to table 112 and table 114.
A Vendor Ledger Entry No. field is added to table 122 and table 124.
If any of the upgrade preconditions are not met, the Upgrade Error Log window will appear and list the errors. To correct any errors that may occur, select the error in the Upgrade Error Log window and choose Show. This will open the relevant page and, where it is possible, show the specific record with the error. Microsoft Dynamics NAV stores the last successfully processed table in the State Indicator table. To view the entries in the State Indicator table, choose Status, and then, in the Upgrade – New Version page, choose Status Indicator.
Optionally, to empty the upgrade log, on the Navigate tab, choose Time Log, and then, in the Upgrade Time Log window, select all entries and then choose Delete.
Repeat this procedure for all companies in the database.
Task 12: Import upgraded permission sets and permissions
If the customer has changed the Read/Write/Modify/Delete/Execute settings for any of the standard permissions, or customized default permission sets in any way, you must merge these changes into the default permissions sets and permissions that are included in Microsoft Dynamics NAV 2013 R2.
Microsoft Dynamics NAV 2013 R2 includes updates to roles and permissions. Your local Microsoft country/region office may include two text files in the upgrade toolkit. If two such text files are not included, use XMLport 104001 Import/Export Roles and XMLport 104002 Import/Export Permissions to export the new default roles and permissions from the CRONUS International Ltd. demonstration database in Microsoft Dynamics NAV 2013 R2.
Now, you must merge the roles and permissions that you exported as part of task 5 with the Microsoft Dynamics NAV 2013 R2 roles and permissions.
To import the permission sets and permissions
In Object Designer, choose page 9802 Permission Sets, and then choose Run.
Delete all permission sets except the SUPER permission set.
In Object Designer, choose page 104002 Upgrade – New Version, and then choose Run.
To import the user roles from the merged PermissionSets.xml file, choose Import Roles.
To import the permissions from the merged Permissions.xml file, choose Import Permissions.
This completes the data upgrade. Next, you remove the upgrade toolkit objects from the upgraded database.
Task 13: Delete the upgrade toolkit objects
You have upgraded the database to Microsoft Dynamics NAV 2013 R2. Now you can delete the upgrade toolkit objects from the database.
To delete the upgrade toolkit objects
In Object Designer, choose page 104002 Upgrade – New Version, and then choose Run.
Choose Mark/Delete Upgrade Toolkit.
This removes all upgrade toolkit objects except tables.
In Object Designer, choose Tables, set a field filter on the Version List field for tables that are marked as Upgrade Toolkit Table – marked for deletion, choose Edit, and then choose Delete.
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 2013 R2. 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
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.
See Also
Concepts
Upgrading the Application Code
Automating the Upgrade Process using Sample Windows PowerShell Scripts
Upgrade Quick Guide