Disabling automatic database upgrades when upgrading Microsoft Dynamics or installing updates

When managing multi sever Dynamics implementations for our clients. It has always been beneficial to disable the automatic database upgrades which occur when you are either doing a full version Dynamics upgrade (ie. CRM 2016 to 365.) or applying patches/updates. If you do not disable automatic database upgrades and you have multiple front ends, what will happen is the database upgrade script will run on your organization multiple times. This will waste time as the database upgrades can take up to an hour depending on your organization size and will add unnecessary database transactions.
After you have disabled automatic database upgrades, you can then apply the application patches only which is fairly quick. Once that’s done, you would do a database upgrade through Dynamics Deployment Manager by right clicking on your organization then clicking upgrade organization.
Below are the powershell commands to view the current settings and also change the settings to disable the automatic upgrade.
How to view the current database upgrade setting:

Add-PSSnapin Microsoft.Crm.PowerShell
(get-CrmAdvancedSetting -ConfigurationEntityName "Deployment" -Setting "AutomaticallyInstallDatabaseUpdates").Attributes

Disable the automatic database upgrade:

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


Leave a Reply

Your email address will not be published. Required fields are marked *

Let's talk

If you want to get a free consultation without any obligations, fill in the form below and we'll get in touch with you.