NAV2015 upgrade step-2

Roelof
Member Posts: 377
In Upgrade Step2, upgrading from Nav2009 to NAV2015), there is a function called 'UpdateUserID'. Does anyone know if this function is required to be run (and what it is doing)? I noticed during a test-upgrade run that this function taking a long time before it completes.
Roelof de Jonghttp://www.wye.com
0
Answers
-
You are right. this function will validate all G/L Entries with all users in database.
we have commented this function to upgrade one of our customers which is having 300GB0 -
This function replaces occurences of the "User ID" field with "Domain\User ID". If you look in a 2009 database, the "User setup" table has user id's without domain prefix(es). In 2013 and later, it has the domain prefix.
RonRon0 -
So, what impact would it have by not running it during the upgrade? (Upgrade from 2009R2 to NAV2015. Legacy database is on SQL).Roelof de Jonghttp://www.wye.com0
-
We did it with a SQL-script...
--**************************************************************************************************************
-- Christer Berntsson, Softronic, Stockholm, Sweden, 2015-06-17
--
-- Idea from Lars Westman, Umeå, Sweden
--
-- Update all columns in NAV-2013--> with domainname
--
-- This script should be run in SQL-server Management Studio
--
-- 2015-06-17: In a Nav2015-database with 8 Companies and Size of 87GB on SSD-discs it took aprox 5 minutes.
--
-- Test it before You use it
--**************************************************************************************************************
USE [Nav2015_XYZ] -- <<-- Your database
GO
--Use a temporay table
CREATE TABLE [#User ID Fields] (Tablename varchar(250), Fieldname varchar(50), Size int)
--Fill temporay table with tablename and field
INSERT INTO [#User ID Fields] (Tablename, Fieldname, Size)
SELECT
o.name
,c.name
,c.max_length
FROM
sys.columns c
Join sys.objects o on o.object_id = c.object_id
WHERE
c.name like '%User_ID%'
and o.type_desc like 'USER_TABLE' --only usertables
and c.system_type_id = 231 --only textfields
-- add Your own filters and exceptions
ORDER BY
o.name
--DEV:
--select * from [#User ID Fields] -- Show table who contain '%User_ID%' and is text-fields
DECLARE @sql nvarchar(MAX),
@CompanyName nvarchar(254),
@Tablename nvarchar(254),
@Fieldname nvarchar(254),
@Domain nvarchar(254),
@Size int
SET @Domain ='TheDomainName'
--Start loop all Companies and Tables and Fields
DECLARE UpdateCursor CURSOR FORWARD_ONLY FOR
SELECT Tablename, Fieldname, Size FROM [#User ID Fields]
OPEN UpdateCursor
FETCH NEXT FROM UpdateCursor INTO @Tablename, @Fieldname, @Size
@FETCH_STATUS = 0
BEGIN
PRINT getdate()
SET @sql = 'UPDATE SET = CASE WHEN LEN()<>0 THEN '''+ @Domain+'\''+REVERSE(LEFT(REVERSE(),CHARINDEX(''\'',REVERSE(''\''+))-1)) ELSE END'
PRINT @sql
EXEC (@sql)
FETCH NEXT
FROM UpdateCursor
INTO @Tablename, @Fieldname, @Size
END
--Clean up
CLOSE UpdateCursor
DEALLOCATE UpdateCursor
DROP TABLE [#User ID Fields]
Regards
Christer in Stockholm, Sweden0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions