Timeout issue when migrating commerce on update

Migrates published Catalog Content has failed with exception 'System.Data.SqlException (9x80131904): Execution Timeout Expired. The timeout period elapsed prioer to completion of the operation or the server is not responding.

or if you get:

Failed to clean up meta keys: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

and changing the batch size for removing Orphaned Meta Keys to something lower like 1000 (default is 10,000):

<add key="ecf:RemoveOrphanedMetaKeysBatchSize" value="1000" />

Or:

You can upgrade to Commerce 11.4.

Or:

If you don't want to upgrade you can work around by using these steps (Backup database first):

1. Add this index in the Commerce database:IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('dbo.CatalogContentProperty') AND NAME ='IX_CatalogContentProperty_Temp_Number')DROP INDEX IX_CatalogContentProperty_Temp_Number ON dbo.CatalogContentProperty;GOCREATE NONCLUSTERED INDEX [IX_CatalogContentProperty_Temp_Number]ON [dbo].[CatalogContentProperty] ([Number])INCLUDE ([MetaFieldId])WHERE Number IS NOT NULLGO