Sunday, September 28, 2014

Microsoft CRM 2011: Upgrading Organization from Rollup 11 to Rollup 16

My organization had over 700 fields in the Lead Object, had to pare it down to 662 so that the Rollup 16 database schema updater could create a view called FilteredLead.  First task is to delete enough fields in the Lead object and/or the Account object so that the FilteredLead view would have less than 1024 fields. And then next task is to copy the MSSQL database from production machine to another dev machine running CRM2011.

Installing Rollups is a neccessary and dreaded evil that is necessary to obtain bug fixes and new features in CRM 2011

Build a new CRM 2011 Server that has Windows 2008 R2 Enterprise x64 with SP1, IIS 7.0, Microsoft SQL Server 2008 R2 Enterprise, every Visual Studio Runtime from 2005 to 2013, Dot net framework 4.5, IE9.0, not IE 10 or 11, because they break the CRM Installer Splash Screen. Configure the SQL Report Server.  Install SSL Certs. Lastly, install CRM2011, {server, email router, SRS, reporting extensions} Install Powershell, then reboot!
Cleanup. remove uneeded fields so that FilteredLead has 999 fields.
Shutdown production CRM server and SQL services (R11 version: 5.0. 9690.2839)
Copy MDB and LDB files from MSSQL data directories
Attach them into new MSSQL server
Use Deployment Manager to import org (into R16)
Turn on MSSQL profiler to enable logging of SQL commands
Import Organization
Open Email Router
Bypass http security in Email Router
Add the Administrator user to the PrivUserGroup so that he can edit the email router config.

Bypass Security Trick #1: Reason: This is to ensure that the credentials are not passed in Clear text between the CRM Server and Email Router machines over the wire. Hence it is strongle recommended that you enable HTTPS on your CRM Server and upadte the URL in the deployment tab of email router accordingly.
In addition, you will have to disable the HTTP binding from the CRM Server's website.
There is however a workaround if you do not wish to use HTTPS.
In the CRM Server machine set the registry key as follows:
Path : HKLM\Software\Microsoft\MSCRM
Name : DisableSecureDecryptionKey
Type : DWORD
Value : 1
Enable Tracing in CRM 2011 using powershell.
Add-PSSnapin Microsoft.Crm.PowerShell$setting = Get-CrmSetting TraceSettings$setting.Enabled=$TrueSet-CrmSetting $settingGet-CrmSetting TraceSettings
 Make a directory called c:\crmdrop\logs

Bypass Powershell Security and Enable all of your scripts to Run Freely: (in powershell)
Set-ExecutionPolicy Bypass
Enter Y when prompted.

Rollup 18 Just Came Out:

Modal Dialog boxes are now disabled in Chrome 37.  Turn them back on, until May 2015. How to guide:

Optional: Defer Database Schema Updates PS Script:
------------------------------- cut here ----------------------------------------------
Add-PSSnapin Microsoft.Crm.PowerShell
$setting= New-Object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity"
$setting.LogicalName = "Deployment"
$setting.Attributes = New-Object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection"
$keypair = New-Object "System.Collections.Generic.KeyValuePair[String, Object]" ("AutomaticallyInstallDatabaseUpdates", $false)
Set-CrmAdvancedSetting -Entity $setting
------------------------------- cut here ----------------------------------------------

Optional: Enable Tracing in CRM2011 (into c:\crmdrop\logs)
------------------------------- cut here ----------------------------------------------
Add-PSSnapin Microsoft.Crm.PowerShell
$setting = Get-CrmSetting TraceSettings
Set-CrmSetting $setting
Get-CrmSetting TraceSettings
------------------------------- cut here ----------------------------------------------