SQL Server – Migrating SQL Server 2008 Databases to WSFC SQL2014 AlwaysOn AG

availability-groupsmigrationsql serversql server 2014sql-server-2008

I am currently working on migrating our single FCI Prod SQL Server 2008 Enterprise instance (on Win2008) multiple databases (>2TB total) to a new 2-node WSFC cluster (Win2012 R2 & SQL2014 enterprise) AlwaysOn AG.

The current single FCI prod server will be decommissioned after migration.

I could use LogShipping to migrate from our current single FCI Prod server to the new WSFC cluster Node 1 (Primary).
Then, backup the Node 1 (Primary) db's and Restore on Node 2(Secondary) to prepare Node 2 (Secondary) and then Create/JOIN the AG group.

I would like to reduce the preparation time for the Node 2 (Secondary) i.e. downtime during migration i.e. to avoid separately backing up the Node 1 db's and Restoring on Node 2(Secondary).

If we Logship our current Prod db's to both Node 1 and Node 2 simultaneously, then is it possible to create an AG and JOIN db's on both these Nodes 1 and 2 successfully at the same time?

Best Answer

To perform a server migration to an AG using log shipping, you should log ship to both servers. When you are ready to actually cut over to the new AG, follow the following steps:

  1. Take a final tail log backup on the old instance (BACKUP DATABASE...WITH NORECOVERY)
  2. Restore the backup to both AG nodes (or allow your log shipping to apply it) WITH NO RECOVERY.
  3. On Node 1, bring the the database online (RESTORE DATABASE MyDb WITH RECOVERY)
  4. Add the DB to the AG on Node 1.
  5. Join the secondary DB to the AG.

I'd recommend practicing this routine on your QA system before the real production upgrade. There are a lot of scripts/statements to be run, and lots of switching between servers to do it. It's best to have those steps carefully documented and scripts staged in advance.