Last weekend it was time for me to brew up a strong coffee, clear my schedule and upgrade our Dynamics NAV database from 2016 to 2018. This was a big operation for me and many colleagues as we also upgraded to SQL2017 and Windows server 2016.
The good thing about using a new server environment was that I got to do a trial run with the production conversion. Invaluable it turned out as we found some issues that we had not had converting our Acceptance database. The mail culprit here was an old SQL index that played silly buggers on our item table. I had run into a similar issue before on another database. Removing the index fixed it.
For the Dynamics NAV upgrade I used the steps Microsoft advised in their article https://docs.microsoft.com/en-us/dynamics-nav/upgrading-the-data. I found some issues though so I amended this list for my personal use. With success, I upgraded our ~800Gb database in about 4 hours with zero issues.
For the Powershell lovers among you, sorry, no fancy scripts. I work for an end-user and I don’t mind executing the steps by hand as we only upgrade once a year.
For your information, here is the full list with citations for the sources of my fixes. As always, if you have questions or improvements let me know. Enjoy and happy migrating!
Before the upgrade:
- Code merge. Use the scripts Waldo made
- Install Dynamics NAV 2018
- Create upgrade FOB. Don’t forget upgrade objects
Upgrade:
- Backup database
- Auto create statistics off in SQL Database.
- Database recovery on simple
- Shrink database and files
- Uninstall OMA http://www.msdynamics.de/download/file.php?id=5665&mode=view http://www.msdynamics.de/viewtopic.php?f=68&t=31064
- Open the database with the 2016 object designer and run a 2016 service tier for the database.
- Unlock all objects
- Build all application objects https://docs.microsoft.com/en-us/dynamics-nav/how-to–build-server-application-objects
- Sync database schema https://docs.microsoft.com/en-us/dynamics-nav/how-to–synchronize-the-tenant-database-with-the-application-database
- 2018 Dev license in the database
- Stop all service tiers
- Delete all objects except tables
- In SQL:
- Clear Statistics, https://markbrummel.blog/2017/12/14/nav2018-upgrade-issue-with-sync-navtenant/
- Clear SQL tables before upgrade, delete entries in tables [Debugger Breakpoint] and [Server Instance]. Delete all locks as somehow deleting them in the object designer is not enough. See the sql script below.
- Check for open sessions with sp_who. Kill them if necessary.
- Open NAV2018 Object designer as Administrator https://forum.mibuso.com/discussion/69166/sync-error-invalid-column-name-base-hash
- Open the database in NAV 2018 object designer. Convert the database when prompted.
- Load FOB
- Compile all objects with met Schema Sync on later, when using rtm then clear C:\Users\<USER>\AppData\Local\Temp\Microsoft Dynamics op DY-RAS2 after compile. This is a bug in compiling reports that is fixed in CU1.
- Check version of new objects and make sure the upgrade objects are in the database.
- Connect a NAV2018 service tier
- Open Administration Shell as administrator on the service tier
- Schema sync “Sync-NAVTenant –ServerInstance <ServerInstanceName>”
- Data upgrade “Start-NavDataUpgrade <ServerInstanceName> -Force”
- Check progress with Get-NavDataUpgrade -Progress
- Delete the objects that need to be deleted. There are a few objects in NAV2016 that are not used in NAV2018. For us these were (might not be the same for you, due diligence advised!):
- Table 1305
- Table 1510
- Table 470
- Table 5150
- Table 5181
- Table 5371
- Table 5372
- Table 824
- Table 825
- Table 826
- Table 827
- Table 828
- Table 829
- Table 830
- Table 8640
- Table 9192
- Delete upgrade objects
- Register Clientcontrol add ins
- Install Extensions
- Update Dynamics NAV web client config
- SQL
- Turn on auto create statistics
- Datarecovery on full (or your preferred setting)
- Backup
- Load customer licence
- Do a happy dance
And here is the sql script I used to clear the necessary tables:
DELETE FROM [database].[dbo].[Server Instance] DELETE FROM [database].[dbo].[Debugger Breakpoint] use [database] UPDATE [Object] SET [Locked] = 0, [Locked By] = '';