Migrating a highly available instance is not one job, it is two different jobs that people frequently confuse. An Availability Group migration adds replicas and fails over. A Failover Cluster Instance migration builds a new cluster and cuts over. The sequences are different, the rollbacks are different, and the outage profile is different.
The advantage of migrating an AG is that the cutover is a planned failover, measured in seconds. The cost is that everything before it has to be correct.
Network Pre-Flight
Run these days before the window, from the machines that will actually make the connections. Every check here is a five-second test that has, at some point, cost somebody their maintenance window.
- Port 1433 to the target from the source server, from every application server, and from your own workstation:
Test-NetConnection new-server -Port 1433. A named instance needs its fixed port instead, plus UDP 1434 if clients rely on the Browser service. Walkthrough: testing remote port connectivity with PowerShell. - Port 445 to the backup share, from both sides. The source writes the backups and the target restores them, so test the share from each server, not just the one you happen to be logged into.
- Firewall rules in both directions on the new host. Inbound 1433 is the rule everyone remembers; outbound to the backup share, monitoring, and any linked servers is the one that turns up mid-window. Reference: SQL Server default ports.
- Line of sight from the applications, before cutover. Every app server and VM that will connect must reach the target before the window opens, tested from those machines rather than from the DBA workstation. A connection that fails at pre-flight is a task; the same failure after cutover is an incident.
- Port 5022 between every replica pair, in both directions. The mirroring endpoint is its own listener with its own firewall rule. A new replica that can reach the primary while the primary cannot reach it back will join the AG and then never synchronise.
- The listener itself. Confirm the listener name resolves and answers on its port from the application servers, and in a multi-subnet cluster confirm an IP exists for the subnet the new nodes live in, before the failover rather than during it.
- After cutover: DNS and SPNs. Repoint the CNAME and respect the TTL, because clients keep the old record for exactly as long as you told them to. Then re-register the SPNs for the new host so Kerberos keeps working; miss that and connections either fall back to NTLM quietly or fail with the pre-login handshake error.
Availability Group Migration
Install SQL Server, join the nodes to the Windows Server Failover Cluster, enable the Availability Groups feature and restart, then configure the mirroring endpoint. If the new nodes run a different service account, the endpoint login has to exist on the current primary too.
Back up on the current primary and restore on the new replicas WITH NORECOVERY. This is the long part, and it happens well before any window. Get Backup Restore Duration Estimate tells you how long to allow.
Join them and let synchronisation begin. If the join stops on error 1418, the new replica cannot reach the endpoint, or the database on it is not ready to join.
Do not proceed on “it looks synchronised”. Check the send and redo queues with Check Always On Availability Group Latency, because redo queue is what decides how long a failover actually takes. A planned failover without data loss needs the target in synchronous-commit mode and SYNCHRONIZED (Microsoft’s planned manual failover prerequisites), so switch the new replica to synchronous commit before the window if it was seeding asynchronously.
Confirm the application teams are ready for a brief interruption, and that the listener has an IP address in the new node’s subnet if it is in a different one. Get AG Failover Readiness confirms the target can fail over without data loss. Then fail over and verify.
Only after validation. Remove old replicas from the AG, remove old nodes from the cluster, then update external DNS if the listener name is changing.
A full health check against the new primary, and Check AG Replica Role and Synchronization State to confirm every replica is connected and in sync.
If you are failing over to a node in a different subnet, the listener needs an IP address in that subnet before the failover, not after. Clients resolving the listener to an address that no longer hosts it produces a very confusing 10 minutes.
Failover Cluster Instance Migration
An FCI migration cannot fail over to a new cluster, so it is a build, sync and cut over instead. Build the new FCI, seed it with a full and differential restore, then keep it current with log shipping while you wait for the window, watching it with Get Log Shipping Status. The window itself is a final log backup, a restore, and a cutover.
That log shipping step is what makes the window short. Without it the whole restore happens inside the outage.
The full version, with every command, is in the repo. Both playbooks, both rollback procedures, and timing estimates for each.
Frequently Asked Questions
Which is less risky, AG or FCI migration?
An AG migration, because the cutover is a planned failover you can reverse by failing back. An FCI cutover is a commitment, which is why its rollback procedure is a separate document rather than a paragraph.
Can I add replicas running a newer SQL Server version?
Only as a rolling upgrade: secondaries first, then fail over. Microsoft does not support a mixed-version AG outside that window, and once the newer replica is primary it can no longer ship log to the older ones, so failing back means upgrading them first (upgrading availability group replicas).
How do I know synchronisation is really finished?
Look at the redo queue on the secondary rather than at a green health icon. Data that has arrived but not been applied is exactly the data that extends your failover time.
What if the new servers are in a different cluster?
Then adding replicas is not an option, because an availability group lives inside one Windows Server Failover Cluster. A distributed availability group spans two AGs on separate clusters, and migration to new hardware or a new operating system is one of the uses Microsoft names for it. It is Enterprise edition only.
Do I have to update DNS?
Only if the listener name is changing. If it is, do it after validation and remember the TTL, because clients will keep the old record for as long as you told them to.
Related
Clustered migrations borrow most of their steps from the simpler cases. These are the ones they borrow from, and the incidents they run into.
- SQL Server Migration Runbook: Standalone, the base procedure this one builds on
- SQL Server Version Upgrade Runbook, when the migration is also an upgrade
- Windows Server OS Upgrade Runbook for SQL Server, the rolling cluster upgrade, when the OS is what is changing
- Creating SQL Logins on an Availability Group (AG) Environment, the databases fail over, the logins do not
- Get Login Migration Parity, proves the new replicas carry the same logins
- HADR_SYNC_COMMIT Wait Type in SQL Server, what commit latency looks like once a synchronous replica is added
- Understanding SQL Server AG Latency, what the latency numbers actually mean
- SQL Server Change Management, the change order this belongs to
- DBA Scripts: The Complete Guide
Leave a Reply