CRM 2016 Import Upgrade from CRM 2015 Failure: Timeout expired

CRM 2016 Import  Upgrade from CRM 2015 Failure: Timeout expired

On attempting to upgrade a Microsoft CRM Dynamics 2015 Database to CRM 2016 (without service pack) you receive a Failure: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding..

This happens at the System Check stage.

There are a bunch of suggestions online from earlier releases of CRM like 4.0 etc suggesting that you may need to change the timeout settings on the settings with some DWord changes in the registry. In this case it is not the cause.

Cause

Microsoft has again released an initial version of their software with some significant bugs. The biggest of these being that you cannot import your CRM 2015 database to upgrade to CRM 2016 if it has a Full Text Catalogue. Something that is likely if you have been using the improved searching functions of CRM 2015.

The Fix

All care and no responsibility with this one. The prudent process would be to either upgrade an existing CRM 2015 environment in place, which form all reports will correctly update the CRM database in question to CRM 2016 without error. Alternatively you can wait the months that are likely required for Microsoft to get around to releasing a patch for this problem.

1. Fresh on CRM 2016 SQL Server. Restore your backup of your CRM 2015 database.

2. On the SQL manager, select the Database in question, and select “New Query” (our 2015 dates restore is CRM_MSCRM)

CRM 2016 Upgrade from CRM 2015.png

 

3. In the new Query window. Paste the following code and click Execute.

declare @catid int

select @catid=fulltext_catalog_id from sys.fulltext_catalogs wherename=‘CRMFullTextCatalog’

declare c cursor for

 select sys.tables.name, sys.fulltext_indexes.unique_index_id from sys.fulltext_indexesinner join sys.tables on sys.fulltext_indexes.object_id = sys.tables.object_id wheresys.fulltext_indexes.fulltext_catalog_id=@catid

 open c

 declare @TableName varchar(200), @UniqueID as integer

 fetch next from c into @TableName, @UniqueID

 while @@fetch_status = 0

 begin

 declare d cursor for

 select sys.indexes.name, sys.tables.object_id from sys.tables inner join sys.indexeson sys.tables.object_id = sys.indexes.object_id where sys.tables.name=@TableName andsys.indexes.index_id = @UniqueID

 open d

 declare @KeyIndex varchar(200), @object_id as integer

 fetch next from d into @KeyIndex, @object_id

 if @@FETCH_STATUS <> 0 

 begin

 Print ‘Error with’ + @TableName

 end

 while @@fetch_status = 0

 begin

 BEGIN TRY

 Print ‘CREATE FULLTEXT INDEX ON [dbo].’+@TableName+‘ KEY INDEX [‘+@KeyIndex+‘] on([CRMFullTextCatalog]) WITH (CHANGE_TRACKING AUTO)’

 Print ‘GO’

 declare e cursor for

 select sys.columns.name from sys.columns inner join sys.fulltext_index_columns onsys.columns.object_id=sys.fulltext_index_columns.object_id andsys.columns.column_id=sys.fulltext_index_columns.column_id wheresys.columns.object_id=@object_id

 open e

 declare @ColumnName varchar(200)

 fetch next from e into @ColumnName

 while @@fetch_status = 0

 begin

 Print ‘ALTER FULLTEXT INDEX ON [dbo].’+@TableName+‘ Add (‘+@ColumnName+‘)’

 Print ‘GO’

 fetch next from e into @ColumnName

 end

 close e

 deallocate e

 END TRY

 BEGIN CATCH

 print ‘Error’ + @KeyIndex

 END CATCH

 fetch next from d into @KeyIndex, @object_id

 end

 close d

 deallocate d

 fetch next from c into @TableName, @UniqueID

 end

 close c

 deallocate c

Like this:

SQL Execute Query Key

4. When the query executes successfully. Copy to the Clipboard all of the “Message” output in the bottom half of the screen to your clipboard.

Screenshot 2016 01 21 10 09 54

5. Now Expand the “Storage / Full Text Catalogues” section of the Database in question and select Properties.

Screenshot 2016 01 21 10 11 52

6. Select Table / Views

Screenshot 2016 01 21 10 13 44

7.Using the the little Left pointing arrow. Click it as many times as needed to move all the items on the right to the left. 

Screenshot 2016 01 21 10 15 10

Like this:

CRM 2015 Upgrade to CRM 2016

8. Once finished, select he Script Dropdown and select “Script Action to New Window” (or just click on OK both actions should work)

Screenshot 2016 01 21 10 16 59

 

You should see a Progress script Completed Successfully.

Screenshot 2016 01 21 10 18 32

9. Now Close all the Management for the SQL Server. This is Important.

10. Upgrade your CRM database the normal way using the Microsoft Dynamics Deployment Manager / Organisations / Import Organisation 

Screenshot 2016 01 21 10 21 03

Skip through the steps here as you normally would Noticing that it no longer stalls on the recheck before upgrade.

11. Once the upgrade has finished and you have your database imported and upgraded to CRM 2016, Open the SQL manager for the database in question again, and run a new query against the database as we did in step 3 above.

This time however we are going to paste the output we captured to clipboard in step 4 above, and run that output as a script.

Screenshot 2016 01 21 10 25 15

Click Execute again. And you should be rebuilding the database indexes to a state that will function with the new CRM upgraded database.

P.S. Microsoft. You suck balls at initial releases!

 Source: https://community.dynamics.com/crm/f/117/t/184508

12 Replies to “CRM 2016 Import Upgrade from CRM 2015 Failure: Timeout expired”

  1. Awesome post. I’ve been looking for anything on this issue for the last 2 weeks and finally found this – which fixed our import problem.

  2. When I try to execute the code in step 3, I get the following errors:
    Msg 102, Level 15, State 1, Line 3
    Incorrect syntax near ‘=’.
    Msg 102, Level 15, State 1, Line 7
    Incorrect syntax near ‘wheresys’.
    Msg 102, Level 15, State 1, Line 21
    Incorrect syntax near ‘.’.
    Msg 102, Level 15, State 1, Line 33
    Incorrect syntax near ‘‘’.
    Msg 319, Level 15, State 1, Line 33
    Incorrect syntax near the keyword ‘with’. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
    Msg 102, Level 15, State 1, Line 43
    Incorrect syntax near ‘‘’.
    Msg 102, Level 15, State 1, Line 43
    Incorrect syntax near ‘’’.
    Msg 319, Level 15, State 1, Line 43
    Incorrect syntax near the keyword ‘with’. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
    Msg 102, Level 15, State 1, Line 49
    Incorrect syntax near ‘.’.
    Msg 102, Level 15, State 1, Line 61
    Incorrect syntax near ‘‘’.
    Msg 102, Level 15, State 1, Line 61
    Incorrect syntax near ‘’’.
    Msg 102, Level 15, State 1, Line 77
    Incorrect syntax near ‘‘’.

  3. Just noting here in case anyone else runs into it, but this is still an issue when upgrading CRM 2016 to the Dec. CRM 2016/Dynamics 365 On Premise release and that the steps posted here will still work to help resolve the upgrade problem.

Leave a Reply to Lina B Cancel reply