Wednesday, March 25, 2015

Data Migration To NAV 2013 R2 - Error in Step 2.

Hi All,

It's been a while that i haven't blogged anything.

Today i would like to discuss an issue raised to me by most of the Readers that they face during Data Migration in Upgrade Activity. The Error message occurs before step two after opening database in NAV 2013 R2.

When we open our database in NAV 2013 R2 and import customized objects and then try to Run the NAV 2013 R2 Client, it behaves in an unexpected manner. Instead of opening the client it says -

The operation could not complete because a record in the <<>> table was locked by another user. Please retry the activity.
OR
A connection to the server has been established. preparing your work space.
OR
Fields cannot be found in Marketing setup..


REASON -

Due to introduction of Multitenancy in NAV 2013 R2 there is a slight change in Process of Updating the metadata(structure) of Table in SQL Server.

Till NAV 2013, when we add/remove/modify a field in table it used to directly connect to server and update the metadata in SQL.

With NAV 2013 R2 now when we change an objects in NAV it connect to Service and service then update to SQL Server. For this we also need to make sure that the value in service for Field SQL Command Timeout is SET to 24:00:00 as shown below.



How to Resolve -

Actually its not an issue its just the time that SQL Required to update the metadata of the tables. So here what we should do -

1. After importing merged objects in NAV 2013 R2 Run Sync-Tenant.
2. Once the Sync-Tenant is completed run below query on SQL.

---------------------------------------------------------------------------
-- Author: Saurav Dhyani
-- Create date: 12-11-2014
-- Description: Query to Check Operation in a Database
-- Change the <<Database Name>> with actual database name

select spid,cmd,waittime,lastwaittype,cpu,physical_io,login_time,last_batch,status,hostname,program_name,nt_username, nt_domain
from master.dbo.sysprocesses where dbid = db_id('<<Database Name>>')
---------------------------------------------------------------------------

The query will show you multiple rows with same or different program_name as shown below -


SQL is still in process of updating the metadata until you see cmd for all rows as AWAITING COMMAND.

Once completed we are good to go and start Navision Client.

Good to Have - 
1. During Data Migration Always keep a Backup after Completion of Step 1 & After conversion to NAV 2013.

Stay tuned for more.

Regards,
Saurav Dhyani
www.sauravdhyani.com

No comments:

Post a Comment

Popular Posts