HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Quickest way to migrate mirroring to AG

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
quickestwaymigratemirroring

Problem

Scenario is this, prod is two two node FCI with mirroring (primary/disaster DC). This is working just fine. New hardware is coming and a version upgrade to SQL Server 2012 (from 2008 R2) in the form of two two node FCI in primary with async AG to get the data over to the second FCI. (DR is all SAN mirroring with identical boxes in DR site)

Can I take the 2008 R2 primary and log ship all my databases to the SQL Server 2012 FCI primary while it is in an AG?

If not, I can leave the AG off and just log ship to do the migration, go live and setup the AG after the fact, that's not the end of the world. Just trying to see if I can skip the this setup.

Solution

If you want to ensure you minimize the amount of time you are without HA during your migration, here's a trick I recently used:

  • Set up the AG with a "dummy" database so that your AG is ready in advance.



  • Log ship the database(s) to both your primary & secondary AG replicas--at this point, the log shipped database is not part of the AG, you're just doing the log shipping in parallel to all nodes.



  • When you're ready to cut-over:



  • Take your final tail log backup on the old server.



  • Restore the tail log to both AG replicas, and on the primary node, restore WITH RECOVERY.



  • Take a log backup from the primary node, and restore it to secondary WITH NORECOVERY. (At this point, your secondary node is pre-seeded and ready to be added to the AG)



  • Add the DB to the AG, without having to do backup/restore.

Context

StackExchange Database Administrators Q#134016, answer score: 9

Revisions (0)

No revisions yet.