SQL 2016 to 2022 AG migration on Azure VMs: how to keep the existing DNN listener name working for apps that cache DNS and can't be restarted?

Abimbola Adeniran 106 Reputation points
2026-09-30T23:26:27.3066667+00:00

Environment

  • Source: 2-node SQL Server 2016 AG on Azure VMs, using a DNN listener
  • Target: new 2-node SQL Server 2022 AG on Azure VMs,
  • Database: about 4 TB, to be migrated using a distributed AG
  • Clients: many applications and reports that use the existing listener name. We can't find every connection string, so the name must keep working after cutover.
  • The applications cache DNS records, use long-lived connection pools, and can't be restarted.

Question After cutover to the 2022 AG, what is the best way to keep the existing listener name working for these clients without restarting the applications? Since a DNN registers the node IPs, clients with cached records will still point at the old 2016 nodes. What approach would you recommend?

SQL Server Database Engine

2 answers

Sort by: Newest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Senthil kumar 2,580 Reputation points
    2026-10-01T05:00:09.3766667+00:00

    Hi @Abimbola Adeniran

    In this scenario, I would not recommend relying solely on a DNS change or attempting to reuse the existing DNN listener immediately after cutover.

    The challenge is that DNN listeners publish the IP addresses of the cluster nodes in DNS. Applications that cache DNS responses or maintain long-lived connection pools may continue attempting connections to the old SQL Server 2016 AG nodes long after the cutover has occurred.

    A common approach is:

    1. Perform the cutover to the SQL Server 2022 AG using the Distributed AG.
    2. Leave the SQL Server 2016 AG online temporarily.
    3. Configure the old environment to forward or redirect client connections to the new SQL Server 2022 listener.
    4. Allow cached DNS entries and existing connection pools to age out naturally.
    5. Decommission the old AG only after confirming that client traffic has migrated successfully.

    If preserving the original listener name is a hard requirement, a more predictable solution is to place a stable network endpoint in front of the AGs, such as:

    • an Azure Load Balancer,
    • a DNS alias (CNAME),
    • or another abstraction layer whose backend target can be changed during migration.

    This avoids depending on client DNS cache expiration and reduces the impact of applications that cannot be restarted.

    For environments where applications maintain long-lived pooled connections and connection strings cannot be fully inventoried, a phased migration strategy with temporary coexistence of the old and new AGs is generally the lowest-risk option. It provides a transition period during which existing sessions continue functioning while new connections are directed to the SQL Server 2022 environment.

    Recommendation

    Keep the SQL Server 2016 AG available for a transition period after cutover and use a redirection mechanism (DNS alias, load balancer, or network-level abstraction) rather than depending on clients promptly refreshing DNN listener records. This approach minimizes disruption for applications that cache DNS entries or maintain persistent connection pools.

    Thanks.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.