Forum Discussion
SQL Server - Always On High Availability Group Setup
We have an Always On High Availability Group setup with three database servers — two on the same subnet and one on a different subnet. The application server interacts with these database servers through the AG listener.
Currently, this setup is running with application version X, and we have received a new application version Y for upgrade/migration (which includes database changes).
To perform the application update, please clarify the recommended approach:
Should I remove the database from the Availability Group and point to the primary replica to continue with the application update?
or
Can I proceed with the application update while the Always On configuration remains active, pointing to the AG listener?
1 Reply
- SivertSolemIron Contributor
As with so many things, it depends.
Some applications, such as Sharepoint, attempts to set certain databases to simple mode during upgrade.
This is of course not supported while the database is part of an availability group.
If the application vendor has no guidance, test.
I'd start with testing an upgrade without removing the database from any AG.
If your database is of such a size that removing and re-adding it to an availability group is not a major hassle, and assuming you're not using Contained AGs (SQL2022) what you can do is:
- Set availability group to manual failover mode
- Remove database from availability group
- Upgrade application
- Re-add the database to the availability group.
- You may have to remove existing secondary copies if they are not sufficiently up to date to join.
- Set availability group to automatic failover mode again, if it was previously.
This works because the listener for availability groups connects write intent connections to the primary instance, and does not constrain the connection to the databases belonging to the availability group.
There's no need to reconfigure the application away from the AG listener.