In earlier versions of Microsoft Dynamics CRM, two tables were used for each entity these were enitynameBase and entitynameExtensionBase. With CRM 2013 Microsoft decided to merge the tables to take full advantage of 64-bit architecture which results in improved performance of transactional operations.
When performing an upgrade though we may want to defer the merge process to reduce the time taken to perform the upgrade.
So how do we defer the merge?
During the Microsoft Dynamics CRM Server 2013 Setup, on the Upgrade to Microsoft Dynamics CRM 2013 page, we must leave the choice of the organisation database as <None>.
On the computer where the deployment manager is installed we can configure the following registry key before we perform before we upgrade the 2011 Organisation Database:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
MSCRM\MergeBaseAndExtensionTables
MSCRM\MergeBaseAndExtensionTables
Type: DWORD (32bit)
Value: 0
We can then upgrade the Organisation database through deployment manager by right-clicking the Organisation we want to upgrade, and then click Upgrade.
After we have performed the upgrade, we must set the registry setting back via:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
MSCRM\MergeBaseAndExtensionTables
MSCRM\MergeBaseAndExtensionTables
Type: DWORD (32bit)
Value: 1
How do we merge the tables manually?
We must disable the Organisation, then we need to run the merge table tool via the following command to merge all of the tables:
CrmMergeBaseAndExtensionTableTool /s:DEV-SQLS-001 /o:CRM001_MSCRM /log:c:\Logs\mergetoollog.txt
Individual tables can be merged by using the /e parameter followed by the entities we want to merge:
CrmMergeBaseAndExtensionTableTool /s:DEV-SQLS-001 /o:CRM001_MSCRM /e:Account,Contact c:\Logs\mergetoollog.txt
Note: We must make sure that we are a member of the Deployment Administrators and a local Administrator on the local computer where we run the merge table tool, as well as having the Db_owner permission on the Organisation database that we are trying to merge.
If we need to find out which tables haven’t been merged, we can run the following SQL Query against the Organisation database:
SELECT e.Name, e.ExtensionTableName
FROM EntityView e
WHERE e.IsActivity = 0 AND e.ExtensionTableName IS NOT NULL
AND e.IsIntersect = 0
AND e.IsLogicalEntity = 0
ORDER BY e.Name
Once we have finished merging the tables we can then enable the Organisation in deployment manager.
A quick and short post, but hopefully should prove useful.
@simonjen1