Let's take a scenario where you already have a log shipping configuration. You have three databases (db1, db2, and db3) that are set up for log shipping among three different data centers. The primary server for all three databases is AlwaysOn-srv1. The secondary servers are on AlwaysOn-srv2 and AlwaysOn-srv3. The nodes that host these server instances belong to a single Windows Server Failover Clustering (WSFC) cluster.
Each log-shipping primary database will become an AlwaysOn primary database, and each log-shipping secondary database will become an AlwaysOn secondary database.
Note: An AlwaysOn database is also known as an availability database.
To migrate the log shipping databases on AlwaysOn-srv1, AlwaysOn-srv2, and AlwaysOn-srv3 into a new availability group, perform the following steps:
Connect to the log-shipping primary server (AlwaysOn-srv1), and perform the following steps:
LSbackup_<dbname>
Tip: Alternatively, if you are including a lot of databases in an availability group and no other SQL Server aAgent jobs do not need to run while you are converting the databases from log shipping to AlwaysOn Availability Groups, you could stop SQL Server Agent until the conversion is finished.
2. On the first secondary server (AlwaysOn-srv2), prepare the secondary databases for an availability group .
Connect to AlwaysOn-srv2, and perform the following steps:
LSCopy_<primaryServername>_<dbname> and LSCopy_<primaryServername>_<dbname>
Important: Before you create the availability group, make sure that all the log files are restored. You can go to the job history dialog for the log shipping restore job to check this.
3. On the other secondary server (AlwaysOn-srv3), prepare the secondary databases for an availability group .
Connect to AlwaysOn-srv3. Then perform the same steps that are described in Step 2.
Important: Before you create the availability group, make sure that all the log files are restored. You can go to the job history dialog for the log shipping restore job to check this.
4. Create the availability group and join the secondary databases to it.
As soon as possible, connect to AlwaysOn-srv1 and launch the New Availability Group Wizard. For information about how to use this wizard, see Use the New Availability Group Wizard (SQL Server Management Studio) in SQL Server 2012 Books Online.
The wizard will prompt you for information. For the example presented here, the following information is particularly relevant:
The availability group will be created using the specified name. This availability group will contain three availability replicas and the three databases. On each of the secondary replicas, the wizard will attempt to join each of the secondary databases to the availability group.
5.Use the Results page of the wizard to verify whether the secondary databases have successfully joined the availability group on each of the secondary replicas.
Note: When a secondary database joins the availability group, data movement begins between the corresponding primary database and the joined secondary database.
6.Follow up after running the wizard: Depending on the success or failure of the join-database operations, perform one of the following actions:
Start over, as follows:
For a given availability replica, the appropriate action depends on whether some of the join-database operations failed, as follows:
Remove log shipping from the local secondary databases, as follows:
Repeat Steps b–d for each of the log-shipping databases.
Retain log shipping on the secondary server(s) whose secondary databases failed to join the availability group, and complete the following steps:
Disable log shipping on each of the primary databases, as follows:
Repeat these Steps b–d for each of the databases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.