<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Availability Group Upgrade - Techyaz.com</title>
	<atom:link href="https://techyaz.com/tag/availability-group-upgrade/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Mon, 04 Jun 2018 14:47:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>Availability Group Upgrade - Techyaz.com</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Upgrade or Patch SQL Server Failover Cluster Instance Running with Availability Group</title>
		<link>https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/</link>
					<comments>https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 04 Jun 2018 14:39:57 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[Availability Group Upgrade]]></category>
		<category><![CDATA[Clustering]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2391</guid>

					<description><![CDATA[<p>I have explained step by step process to upgrade or patch SQL Server instance that hosts an Always on Availability Group (AOAG) to latest version in attached article. Here, I will explain how to upgrade or patch SQL Server failover&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/">Upgrade or Patch SQL Server Failover Cluster Instance Running with Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have explained step by step process to <strong><a href="https://techyaz.com/sql-server/upgrade-patch-availability-group-instances/" target="_blank" rel="noopener">upgrade or patch SQL Server instance that hosts an Always on Availability Group (AOAG)</a></strong> to latest version in attached article. Here, I will explain how to upgrade or patch SQL Server failover cluster instance running with Always on Availability Group. We should plan and execute such upgrades carefully to avoid any risk during execution. The process to upgrade or patch SQL Server cluster instances running with AOAG is quite similar.</p>
<p><strong>NOTE:</strong> Always test any solution in Lower life cycle environment before deploying it to Production.</p>
<h3><span style="color: #333399;">Points to Remember</span></h3>
<ol>
<li>I have described steps to upgrade or patch SQL Server failover cluster instance having always on availability group. Do not use these steps while upgrading or patching Windows clustering or standalone SQL Server instances running with Always on Availability groups. If you have AOAG configured on standalone SQL Server instances then read <strong><a href="https://techyaz.com/sql-server/upgrade-patch-availability-group-instances/" target="_blank" rel="noopener">attached article</a></strong>.</li>
<li>During the upgrade process, a secondary replica will not be available for failover or for read-only operations, and after the upgrade, it may take some time for the secondary replica to catch up with the primary replica node depending upon the volume of activity on the primary replica node (so expect high network traffic).</li>
<li>A higher version of a SQL Server instance cannot be added as a new replica to an existing AOAG. For example, a SQL Server 2016 replica cannot be added to an existing SQL Server 2014 AG.</li>
<li>Always first upgrade secondary replica then primary replica because an upgraded primary replica can no longer ship logs to any secondary replica. This may cause data loss as data movement to a secondary replica is suspended.</li>
</ol>
<h3><span style="color: #333399;">Planning </span></h3>
<p>We should be very careful while planning upgrade or Patching for your SQL Server Failover cluster instances and if your SQL Server cluster instances are running with availability groups then you need to be more careful considering its complex configuration. Here, i have given multiple steps that you need to plan during patching any AOAG cluster instance.</p>
<ol>
<li>Make sure you can directly upgrade to the latest version of SQL Server 2017. If you are running with SQL Server 2005, you cannot go directly to SQL Server 2017. You must upgrade SQL Server 2005 to SQL Server 2012, 14 or 2016 before moving to latest version SQL Server 2017.</li>
<li>Identify your databases if they are involved in Change Data Capture or Replication then we need to perform some additional activities. These additional steps are given later in this article.</li>
<li>Run DBCC CHECKDB to make sure there is no corruption on databases hosted on these cluster instances.</li>
<li>You must run Full database backups for all your databases to secure a copy in case anything goes wrong and we need it to restore databases.</li>
<li>Make sure Always on Availability Group is working fine and in Healthy state. Fix the issues and make your AOAG configuration in healthy state before going with the upgrade.</li>
<li>Disable the backup job from the system that is going to upgrade (current secondary replica) and make sure to run it from the server that is online and acting as primary replica at the time upgrade will process. You can also <strong><a href="https://techyaz.com/sql-server/sql-server-administration/understanding-sql-server-backup-databases-availability-group/" target="_blank" rel="noopener">change the Backup Preferences of AOAG</a></strong> to run backups always from primary replica during this upgrade.</li>
<li>No replicas are readable or available for backups during a version upgrade whereas during a non-version upgrade you can configure automated backups to run on secondary replicas prior to upgrading the primary replica.</li>
<li>Choose Upgrade approach. As we know, there are three approaches to perform any SQL Server upgrade. In-place upgrade, Side by side upgrade and Rolling upgrade. We will be using rolling upgrade process to apply patch or upgrade SQL Server cluster instances. This approach is used if your SQL Server Instances are required to upgrade in particular sequence. We use this approach if SQL Server is configured with Always on availability group, Database Mirroring, Log Shipping, Replication, Failover Cluster Instances, SQL Server Reporting Scale-out environment.</li>
<li>Make sure that synchronization state of the failover target is SYNCHRONIZED during any failover of Availability Group.</li>
<li>Develop a rollback plan. Executing this plan will enable you to restore your original environment if you need to rollback.</li>
<li>Plan to test the upgrade on Lower life cycle first before deploying on productions.</li>
</ol>
<h3><span style="color: #333399;">Upgrade or Patch SQL Server Failover Cluster Instance running with Availability Group</span></h3>
<p>Here, I will explain how to upgrade or patch SQL Server failover cluster Instance running with Always on Availability group. Let me describe the cluster setup first for this upgrade.</p>
<ul>
<li>We have four database servers that are hosted in two data centers. Two nodes in each data centers.</li>
<li>All four nodes are part of same windows cluster group. two set of storage have been shared between two nodes to install SQL Server failover cluster.</li>
<li>Two SQL Server Failover Cluster Instances have been installed on these nodes of each data centers. One SQL Server failover cluster instance named <strong>FCIA</strong> is installed in data center 1 and another SQL Server cluster instance named <strong>FCIB</strong> is hosted in data center 2.</li>
<li>We have configured Availability Group between these two SQL Server failover cluster instances.</li>
<li>Each SQL Server cluster instance has two nodes. One active and one passive node in their respective data centers. Although active node in data center 2 is not active for connections but this will work as primary in case AOAG failover.</li>
<li>Databases are hosted on shared storage that is connected to their respective nodes in their data centers. You can see this configuration depicted in below image.</li>
</ul>
<p><img fetchpriority="high" decoding="async" class="wp-image-2392 aligncenter" src="https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-1024x333.jpg" alt="Patch SQL Server failover cluster instance running with AOAG" width="757" height="246" srcset="https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-1024x333.jpg 1024w, https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-300x98.jpg 300w, https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min-768x250.jpg 768w, https://techyaz.com/wp-content/uploads/2018/06/AOAG-FCI-Patching-min.jpg 1115w" sizes="(max-width: 757px) 100vw, 757px" /></p>
<p>Now we have to upgrade or patch this AOAG cluster instance configuration. Keep reading this article to understand step by step process to patch such complex AOAG configuration.</p>
<p>We can see above SQL Server cluster instances have Always on Availability Group so we will follow rolling upgrade process to perform upgrade or patch on these SQL Server cluster instances. The sequence to upgrade SQL Server cluster instances having AOAG configuration is to go from passive to active. We will upgrade the inactive nodes before upgrading the active nodes. Have a look at below step by step process.</p>
<ol>
<li>First upgrade or patch passive node of SQL Server cluster instance <strong>FCIB</strong> i.e. <em><strong>Node 4</strong></em>.</li>
<li>Once you will update node 4 of above image configuration then next step is to <em><strong>failover</strong></em> second SQL Server cluster instance FCIB to upgraded instance Node 4 that is hosted in data center 2.</li>
<li>Once you performed failover for cluster instance <strong>FCIB</strong> to node 4 then next step is to patch <em><strong>node 3</strong></em> that will be in passive state of this inactive SQL Server cluster instance. You can failback SQL Server cluster instance FCIB to node 3 again post patching. This failback is an optional step and not mandatory. Now you have applied latest patch level or upgraded your SQL Server cluster instance FCIB hosted in two cluster nodes in data center 2. Next, we will follow same process to apply patches in data center 1.</li>
<li>Apply patch on SQL Server cluster <em><strong>node 2</strong></em> or upgrade SQL Server cluster node installed on node 2 machine as it’s passive node of SQL Server cluster instance <strong>FCIA</strong>.</li>
<li>Once you have upgraded or patched node 2 in data center 1 next we will <em><strong>failover</strong></em> SQL Server cluster instance FCIA to node 2. Now node 2 will run active instance of SQL Server cluster setup. But If you have enabled change data capture feature or replication configured on your SQL Server cluster instance then you should run few additional steps as described here. Once you upgraded or patched all secondary replicas then fail over the Availability Group to an upgraded instance. Now run below command on your primary replica.</li>
</ol>
<pre style="padding-left: 60px;"><strong><span style="color: #0000ff;">EXECUTE [master].[sys].[sp_vupgrade_replication];</span></strong></pre>
<ol start="6">
<li>Go ahead after execution of above command and upgrade or patch SQL Server cluster instance that was originally the primary replica i.e. Node 1</li>
</ol>
<ol start="7">
<li>Now, patch SQL Server cluster instance that is hosted on <em><strong>node 1</strong></em> and was original primary replica that is now acting as passive in this cluster setup. Once done you can failback SQL Server cluster instance FCIA to again node 1 as active node. Here, you have patched or upgraded all SQL Server cluster instances hosted on these four nodes.</li>
</ol>
<p>Here, I have described how to upgrade or patch SQL Server failover cluster instance that is running with Always on Availability Group. I hope you like this article. Please follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p><span style="color: #800000;"><em><strong>Read More:</strong></em></span></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/restore-database-participating-alwayson-availability-group/" target="_blank" rel="noopener">How to Restore a Database participating in AOAG?</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noopener">SQL Server Alwayson Interview Questions &amp; Answers</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/" target="_blank" rel="noopener">Change Failover Mode of Availability Replica in AOAG</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/add-database-availability-group/" target="_blank" rel="noopener">Add a New Database to Availability Group</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/">Upgrade or Patch SQL Server Failover Cluster Instance Running with Availability Group</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Upgrade or Patch Alwayson Availability Group Instances?</title>
		<link>https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/</link>
					<comments>https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 13:44:59 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[AOAG]]></category>
		<category><![CDATA[availability group]]></category>
		<category><![CDATA[Availability Group Upgrade]]></category>
		<category><![CDATA[SQL Server Patching]]></category>
		<category><![CDATA[SQL Server Upgrade]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1737</guid>

					<description><![CDATA[<p>If you are planning to upgrade your SQL Server instance that hosts an Always on Availability Group (AOAG) to a latest version SQL Server 2017 or you are planning to patch Alwayson Availability Group instances, then you should plan it&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/">How to Upgrade or Patch Alwayson Availability Group Instances?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you are planning to upgrade your SQL Server instance that hosts an <strong><a href="http://techyaz.com/sql-server/alwayson-availability-group/" target="_blank" rel="noopener">Always on Availability Group</a></strong> (AOAG) to a latest version SQL Server 2017 or you are planning to patch Alwayson Availability Group instances, then you should plan it carefully to minimize downtime and any risk during these activities. I would suggest you read this article before upgrading or patching SQL Server instances that has Always on Availability Group configured.</p>
<p><span style="color: #000000;"><strong>NOTE:</strong> <strong>First Test this solution in Lower Life Cycle environment then deploy in Production.</strong></span></p>
<h3><span style="color: #333399;">Points to Remember </span></h3>
<p><img decoding="async" class="size-full wp-image-1740 alignright" src="http://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min.png" alt="Upgrade or Patch SQL Server AOAG Instances" width="300" height="300" srcset="https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min.png 300w, https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min-150x150.png 150w, https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min-160x160.png 160w, https://techyaz.com/wp-content/uploads/2018/02/Upgrade-AOAG-min-320x320.png 320w" sizes="(max-width: 300px) 100vw, 300px" />Below are important points you should always keep in mind while you are planning or upgrading SQL Server Instances that has Alwayson Availability Group configured.</p>
<ol>
<li>All steps given in this article are limited to upgrading or patching SQL Server Instances that has AOAG configuration. It does not cover operating system upgrade.</li>
<li>Secondary replica will not be available for failover or for read-only operations during the upgrade process.</li>
<li>A higher version of a SQL Server instance cannot be added as a new replica to an existing AOAG. For example, a SQL Server 2016 replica cannot be added to an existing SQL Server 2014 AG.</li>
<li>Don’t upgrade primary replica instance before upgrading or updating any other secondary replica instance. An upgraded primary replica can no longer ship logs to any secondary replica. This may cause data loss as data movement to a secondary replica is suspended.</li>
</ol>
<h3><span style="color: #333399;">Upgrade or Patch SQL Server AOAG Instances &#8211; Prerequisites</span></h3>
<p>Make sure to meet and follow below prerequisites during planning the upgrade or patching of SQL Server Availability Group Instances.</p>
<ol>
<li>Review the Hardware and software requirements for latest SQL Server version on which you are planning to upgrade.</li>
<li>Make sure your application is supported on the latest version of SQL Server on which we are upgrading.</li>
<li>Make sure you can directly upgrade to the latest version of SQL Server 2017. If you are running with SQL Server 2005, you cannot go directly to SQL Server 2017. You must upgrade SQL Server 2005 to SQL Server 2012, 14 or 2016 before moving to latest version SQL Server 2017.</li>
<li>Choose Upgrade approach. As we know, there are three approaches to perform any SQL Server upgrade. In-place upgrade, Side by side upgrade and Rolling upgrade. As we are planning to upgrade AOAG instance so we will choose Rolling Upgrade method. Below are the details of other upgrade methods.</li>
</ol>
<ul>
<li><strong>In-Place Upgrade:</strong> SQL Server setup program upgrades the existing SQL Server installation by replacing the existing SQL Server bits with the new SQL Server bits and then upgrades each of the system and user databases. This method is frequently used in a development environment without a high-availability (HA) configuration or a non-mission critical production environment that can tolerate downtime and that is running on a recent hardware and software.</li>
<li><strong>Side by Side Upgrade:</strong> We build new machine and install all required software keeping source system running separately and then migrate all databases from source to this newly build machine. This method is effective in minimizing the downtime or in case if you need to roll back the upgrade.</li>
<li><strong>Rolling Upgrade:</strong> This method is used if your SQL Server Instances are required to upgrade in particular sequence. We use this approach if SQL Server is configured with Always on availability group, Database Mirroring, Log Shipping, Replication, Failover Cluster Instances, SQL Server Reporting Scale-out environment.</li>
</ul>
<ol start="5">
<li>Develop a rollback plan. Executing this plan will enable you to restore your original environment if you need to rollback.</li>
<li>Plan to test the upgrade on Lower life cycle first before deploying on productions.</li>
<li>Identify your databases if they are involved in Change Data Capture or Replication then we need to perform some addition activities. Have a look into last section of this article before performing the upgrades.</li>
</ol>
<h3><span style="color: #333399;">Upgrade or Patch AOAG Instances &#8211; Planning</span></h3>
<p>Here, I am explaining how to plan SQL Server Availability Group instance patching or upgrade to the newer version. Have a look at below points.</p>
<ol>
<li>Check database integrity on every availability databases that we are going to upgrade. Run DBCC CHECKDB to make sure there is no corruption on databases.</li>
<li>Run Full database backups for all your databases to secure a copy in case anything goes wrong we need it to restore databases.</li>
<li>Make sure Always on Availability Group is working fine and in Healthy state. You can test a manual failover whether it is working fine or not. If any issue during failover or AOAG not in healthy state, you must fix it before going with the upgrade.</li>
<li>Disable the backup job from the system that is going to upgrade (current secondary replica) and make sure to run it from the server that is online and acting as primary replica at the time upgrade will process. You can also<strong> <a href="http://techyaz.com/sql-server/sql-server-administration/understanding-sql-server-backup-databases-availability-group/" target="_blank" rel="noopener">change the Backup Preferences of AOAG</a> </strong>to run backups always from primary replica during this upgrade.</li>
<li>The sequence will be always upgrade the remote secondary replica instances first, then local secondary replica instances next, and the primary replica instance last. If you upgrade the primary replica instance without failing over the Always on availability Group to an upgraded instance with a secondary replica then client applications may suffer extended downtime during the upgrade on the primary replica instance. So better to follow the sequence to reduce downtime.</li>
<li>Always failover the AOAG to a synchronous-commit secondary replica instance. If you fail over to an asynchronous-commit secondary replica instance, you might lose some of your data.</li>
<li>Make sure that synchronization state of the failover target is SYNCHRONIZED during any failover of Availability Group.</li>
</ol>
<h3><span style="color: #333399;">Upgrading or Patching Always on Availability group Instances</span></h3>
<p>Now you have planned and understand the rolling upgrade methodology and the upgrade process of AOAG configured SQL Server Instances. Here, i will explain upgrade or patching of availability group instances into two sections. One has multiple secondary replicas and another have only one secondary replica that also in remote location for DR purpose.</p>
<h5><span style="color: #ff6600;">If Availability Group has Local and Remote Secondary Replicas</span></h5>
<p>Here, I am giving a standard process to perform the upgrade on a configuration that has local secondary replicas as well as remote secondary replicas for DR solution. You can consider it as four replica environments where one replica is hosted on local datacenter and remaining other replicas are hosted on one or multiple remote sites for DR purpose. I have illustrated this configuration in below screenshot where we have one local replica and two remote secondary replicas.</p>
<p><img decoding="async" class="aligncenter wp-image-1741 size-large" src="http://techyaz.com/wp-content/uploads/2018/02/1-min-1024x499.png" alt="AOAG with four replicas" width="1024" height="499" srcset="https://techyaz.com/wp-content/uploads/2018/02/1-min-1024x499.png 1024w, https://techyaz.com/wp-content/uploads/2018/02/1-min-300x146.png 300w, https://techyaz.com/wp-content/uploads/2018/02/1-min-768x374.png 768w, https://techyaz.com/wp-content/uploads/2018/02/1-min.png 1873w" sizes="(max-width: 1024px) 100vw, 1024px" />Let’s start with upgrade process considering above scenario.</p>
<ol>
<li>Verify you have full database backup for all availability databases. If you don’t have full backups, make sure to run it before this upgrade to protect your data.</li>
<li>Now, change automatic failover on synchronous-commit replicas to manual (between replica A and B) to prevent any accidently failovers during upgrade process.</li>
<li>Test a manual failover and make sure that it is working fine.</li>
<li>Now upgrade all remote secondary replica instances (Replica C and D) running with asynchronous-commit secondary replicas.</li>
<li>Upgrade the all local replica secondary instances (Replica B) that are not currently running the primary replica.</li>
<li>Once all secondary replicas have been upgraded and you left out only with primary replica to upgrade then manually fail over the AG to a local synchronous-commit secondary replica. Here, Replica B will be acting as primary replica now.</li>
<li>Upgrade or update the local replica instance that formerly hosted the primary replica (Replica A).</li>
<li>Verify SQL Server version on all replicas to make sure every instance is upgraded. Failback current primary replica from replica B to A that was primary replica initially.</li>
<li>Now, configure automatic failover partners from manual failover (between replica A and B) as we did in step 2 to prevent unwanted failover during upgrade process.</li>
<li>Perform a failover testing on upgraded instances to make sure everything is working fine.</li>
</ol>
<h5><span style="color: #ff6600;">If Availability Group has only One Secondary Replica for DR solution</span></h5>
<p>If you have configured Availability group only to achieve DR solution having single remote secondary replica with asynchronous-commit mode then you need to follow little different approach for upgrade or apply patches.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1742 " src="http://techyaz.com/wp-content/uploads/2018/02/2-min-1024x507.png" alt="AOAG with one remote secondary replica" width="705" height="349" srcset="https://techyaz.com/wp-content/uploads/2018/02/2-min-1024x507.png 1024w, https://techyaz.com/wp-content/uploads/2018/02/2-min-300x148.png 300w, https://techyaz.com/wp-content/uploads/2018/02/2-min-768x380.png 768w, https://techyaz.com/wp-content/uploads/2018/02/2-min.png 1271w" sizes="auto, (max-width: 705px) 100vw, 705px" /></p>
<p>You can follow below step by step method to upgrade or Patch your AOAG instances that has only one secondary replica that also on remote site for DR purpose.</p>
<ol>
<li>Verify you have full database backups to secure your data.</li>
<li>Upgrade your remote secondary replica that is hosted for DR.</li>
<li>Once remote secondary replica is upgraded or Patched, make sure to change the data transfer mode from asynchronous-commit to synchronous-commit to prevent any potential data loss during failover. Do not initiate failover until synchronization state will become SYNCHRONIZED.</li>
<li>Initiate the failover once data is synchronized between both replicas. And once failover will be done again change the data transfer more to asynchronous-commit mode to avoid any data latency issue to application users.</li>
<li>Upgrade the current secondary replica (Previous Primary Replica).</li>
<li>Once both replicas will be upgraded, you can again change the data transfer mode from asynchronous-commit to synchronous-commit to prevent any potential data loss during failover. Do not initiate failover until synchronization state will become SYNCHRONIZED.</li>
<li>Failover the AOAG to remote secondary replica and change the data transfer mode to asynchronous-commit.</li>
<li>Verify details about SQL Server version.</li>
</ol>
<h3><span style="color: #333399;">Additional steps for CDC (change data capture) and Replication</span></h3>
<p>I have described in point no 7 of Prerequisite section to identify databases that are participating in change data capture or in Replication. I have mentioned that because we need to take some additional steps for such databases post upgrade or patching activity.</p>
<ol>
<li>Upgrade each secondary replica as described in above sections.</li>
<li>After all secondary replicas have been upgraded, fail over the AG to an upgraded instance.</li>
<li>Execute below T-SQL statement on the instance that hosts the primary replica:</li>
</ol>
<pre><span style="color: #0000ff;"><strong>EXECUTE [master].[sys].[sp_vupgrade_replication];</strong></span></pre>
<ol start="4">
<li>Upgrade SQL Server instance that was originally configured as primary replica.</li>
</ol>
<p>I hope you like this article. Please Like, Comment, Share &amp; Subscribe to this website to get new articles directly into your inbox. You can also follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/">How to Upgrade or Patch Alwayson Availability Group Instances?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/upgrade-patch-availability-group-instances/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
