{"id":875,"date":"2015-01-12T23:33:50","date_gmt":"2015-01-12T17:33:50","guid":{"rendered":"http:\/\/dotnetsql.info\/net-sql\/?p=875"},"modified":"2015-06-29T15:53:43","modified_gmt":"2015-06-29T09:53:43","slug":"automating-tranzactional-initialization-from-a-backup-in-sql-server","status":"publish","type":"post","link":"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/","title":{"rendered":"Automating Tranzactional Initialization from a backup in SQL Server"},"content":{"rendered":"<h3><strong>Scenario<\/strong><\/h3>\n<p>There are situations where you might have a large SQL Server database that you need to replicate. Since the database is very large we want to initialize the Subscriber from the SQL Server backup and not use a snapshot.\u00a0 How do we bundle all the steps together to achieve this without performing them manually?<\/p>\n<p><strong>Solution<\/strong><\/p>\n<p>I want to cover the basic steps needed to setup a &#8220;Push Type Transactional Replication&#8221;.\u00a0 This tip assumes you already have an understanding of SQL Server Transactional Replication and I will show how to bundle all the steps into one process.\u00a0<!--more--><\/p>\n<p>Before we go get started, let&#8217;s cover some acronyms\/abbreviations used throughout the discussion.<\/p>\n<ul>\n<li>PubServer &#8211; Publisher Server<\/li>\n<li>DtbServer &#8211; Distribution Server<\/li>\n<li>SubServer &#8211; Subscriber Server<\/li>\n<\/ul>\n<p>Assumptions\/Notes: Publisher, Distributor and Subscriber are identified and configured correctly.<\/p>\n<p>First create a batch file (SetupReplSteps.bat) like below.\u00a0 This will be the calling process that will call each individual script for each step of the process.\u00a0 If you review this you can see that I have 8 steps that will be run and they are discussed in more detail below.<\/p>\n<pre>echo ' ' &gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 1 *********************** &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"PubServer\" -E -i\"C:\\ReplSteps\\1_CreatePublication.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>\r\n<\/pre>\n<pre>echo ' ' &gt;&gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 2 *********************** &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"DtbServer\" -E -i\"C:\\ReplSteps\\2_DisableDistCleanAgentJob.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>\r\n<\/pre>\n<pre>echo ' ' &gt;&gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 3 *********************** &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"PubServer\" -E -i\"C:\\ReplSteps\\3_BackupPublisherDatabase.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>\r\n<\/pre>\n<pre>echo ' ' &gt;&gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 4 *********************** &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"SubServer\" -E -i\"C:\\ReplSteps\\4_CopyBakFileFromPubToSub.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>\r\n<\/pre>\n<pre>echo ' ' &gt;&gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 5 *********************** &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"SubServer\" -E -i\"C:\\ReplSteps\\5_RestorePubDatabaseToSub.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>\r\n<\/pre>\n<pre>echo ' ' &gt;&gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 6 *********************** &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"SubServer\" -E -i\"C:\\ReplSteps\\6_DisableAllDbTriggersOnSub.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>\r\n<\/pre>\n<pre>echo ' ' &gt;&gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 7 *********************** &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"PubServer\" -E -i\"C:\\ReplSteps\\7_AddSubscriptionOnPub.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>\r\n<\/pre>\n<pre>echo ' ' &gt;&gt; C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>echo *********************** Step 8 *********************** &gt;&gt;<\/pre>\n<pre>\r\n<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt\r\n\r\n\r\n\r\n<\/pre>\n<pre>SQLCMD -S\"DtbServer\" -E -i\"C:\\ReplSteps\\8_StartDistribCleanupAgent.sql\" &gt;&gt;<\/pre>\n<pre>C:\\ReplSteps\\RepLog.txt<\/pre>\n<p>It is a good practice to log the execution result of all the steps for troubleshooting purposes. Hence, I have re-directed the output to a text file &#8220;RepLog.txt&#8221;.\u00a0 Adjust the above code as needed for your environment.<\/p>\n<p>Once the .bat file is laid out, the steps become self explanatory.<\/p>\n<h2><strong>Step 1: Script your publication<\/strong><\/h2>\n<p>The easiest way to do this is to use SSMS to create the publication and then script out the code or if you prefer you can write the code yourself.\u00a0 In the below example I create a publication and added one article to replicate.<\/p>\n<pre>USE [DBname]\r\n\r\nGO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC sp_replicationdboption @dbname = N'DBname'\r\n\r\n,@optname = N'publish'\r\n\r\n,@value = N'true'\r\n\r\nGO\r\n\r\n\r\n\r\n<\/pre>\n<pre>-- Adding the transactional publication\r\n\r\nUSE [DBname]\r\n\r\nGO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC sp_addpublication @publication = N'DBname_Repl'\r\n\r\n,@description = N'Transactional publication of database ''DBname'' from<\/pre>\n<pre>Publisher ''PHLSQL''.'\r\n\r\n,@sync_method = N'concurrent'\r\n\r\n,@retention = 0\r\n\r\n,@allow_push = N'true'\r\n\r\n,@allow_pull = N'true'\r\n\r\n,@allow_anonymous = N'false'\r\n\r\n,@enabled_for_internet = N'false'\r\n\r\n,@snapshot_in_defaultfolder = N'true'\r\n\r\n,@compress_snapshot = N'false'\r\n\r\n,@ftp_port = 21\r\n\r\n,@allow_subscription_copy = N'false'\r\n\r\n,@add_to_active_directory = N'false'\r\n\r\n,@repl_freq = N'continuous'\r\n\r\n,@status = N'active'\r\n\r\n,@independent_agent = N'true'\r\n\r\n,@immediate_sync = N'false'\r\n\r\n,@allow_sync_tran = N'false'\r\n\r\n,@allow_queued_tran = N'false'\r\n\r\n,@allow_dts = N'false'\r\n\r\n,@replicate_ddl = 1\r\n\r\n,@allow_initialize_from_backup = N'true'\r\n\r\n,@enabled_for_p2p = N'false'\r\n\r\n,@enabled_for_het_sub = N'false'<\/pre>\n<pre>GO\r\n\r\n\r\n\r\n<\/pre>\n<pre>EXEC sp_addpublication_snapshot @publication = N'DBname_Repl'\r\n\r\n,@frequency_type = 1\r\n\r\n,@frequency_interval = 1\r\n\r\n,@frequency_relative_interval = 1\r\n\r\n,@frequency_recurrence_factor = 0\r\n\r\n,@frequency_subday = 8\r\n\r\n,@frequency_subday_interval = 1\r\n\r\n,@active_start_time_of_day = 0\r\n\r\n,@active_end_time_of_day = 235959\r\n\r\n,@active_start_date = 0\r\n\r\n,@active_end_date = 0\r\n\r\n,@job_login = NULL\r\n\r\n,@job_password = NULL\r\n\r\n,@publisher_security_mode = 1<\/pre>\n<pre>GO\r\n\r\n\r\n\r\n<\/pre>\n<pre>USE [DBname]\r\n\r\nGO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC sp_addarticle @publication = N'DBname_Repl'\r\n\r\n,@article = N'ACL'\r\n\r\n,@source_owner = N'dbo'\r\n\r\n,@source_object = N'ACL'\r\n\r\n,@type = N'logbased'\r\n\r\n,@description = NULL\r\n\r\n,@creation_script = NULL\r\n\r\n,@pre_creation_cmd = N'drop'\r\n\r\n,@schema_option = 0x000000000803509F\r\n\r\n,@identityrangemanagementoption = N'manual'\r\n\r\n,@destination_table = N'ACL'\r\n\r\n,@destination_owner = N'dbo'\r\n\r\n,@vertical_partition = N'false'\r\n\r\n,@ins_cmd = N'CALL sp_MSins_dboACL'\r\n\r\n,@del_cmd = N'CALL sp_MSdel_dboACL'\r\n\r\n,@upd_cmd = N'SCALL sp_MSupd_dboACL'<\/pre>\n<pre>GO<\/pre>\n<p>Note I have set @allow_initialize_from_backup = N&#8217;true&#8217;. This will let us use the backup to initialize replication.<\/p>\n<p>The above code for your publication should be saved in a file called &#8220;1_CreatePublication.sql&#8221;.<\/p>\n<h2><strong>Step 2: Disable the replication clean up job <\/strong><\/h2>\n<p>The next step will disable the replication cleanup job.<\/p>\n<pre>USE distribution\r\n\r\nGO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC msdb..sp_update_job @job_name = 'Distribution clean up: distribution',<\/pre>\n<pre>@enabled = 0<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC msdb..sp_stop_job @job_name = 'Distribution clean up: distribution'<\/pre>\n<pre>GO<\/pre>\n<p>Note: We have to do this in our Production environment to ensure if there are issues in the subsequent steps, the transactions are not deleted from the Distributor. This relates to the Minimum Retention time parameter configured on the Distributor.<\/p>\n<p>The above code should be saved in a file called &#8220;2_DisableDistCleanAgentJob.sql&#8221;.<\/p>\n<h2><strong>Step 3: Backup the Publisher Database<\/strong><\/h2>\n<p>The next step is to create a backup of the published database.<\/p>\n<pre>USE master<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>BACKUP DATABASE DBname TO DISK = 'T:\\DBname.bak'<\/pre>\n<pre>GO<\/pre>\n<p>The above code for your database should be saved in a file called &#8220;3_BackupPublisherDatabase.sql&#8221;.<\/p>\n<h2><strong>Step 4: Move the backup file to the Subscriber<\/strong><\/h2>\n<p>We now need to copy the backup file from the publisher to the subscriber server.\u00a0 I am using xp_cmdshell and XCOPY to copy the backup.\u00a0 I am also turning on xp_cmdshell using sp_configure and then turning it off at the end.<\/p>\n<pre>sp_configure 'xp_cmdshell', 1<\/pre>\n<pre>GO<\/pre>\n<pre>reconfigure<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC master..xp_cmdshell 'XCOPY \"\\\\PubServer\\T$\\DBname.bak\" \"\\\\SubServer\\G$\" \/J \/Y'<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>sp_configure 'xp_cmdshell', 0<\/pre>\n<pre>GO<\/pre>\n<pre>reconfigure<\/pre>\n<pre>GO<\/pre>\n<p>The above code for your database backup should be saved in a file called &#8220;4_CopyBakFileFromPubToSub.sql&#8221;.<\/p>\n<h2><strong>Step 5: Restore the database on the Subscriber Server<\/strong><\/h2>\n<p>Now we need to restore the database backup on the subscriber.\u00a0 If the database already exists on the subscriber I am taking it offline and then doing the restore.<\/p>\n<pre>USE master<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>IF EXISTS (SELECT 1 FROM sys.databases WHERE name = 'DBname')<\/pre>\n<pre>\u00a0\u00a0 ALTER DATABASE DBname SET OFFLINE WITH ROLLBACK IMMEDIATE<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>USE master<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>RESTORE DATABASE DBname<\/pre>\n<pre>FROM DISK = '\\\\SubServer\\G$\\DBname.bak'<\/pre>\n<pre>WITH MOVE 'DBname' TO 'R:\\MSSQL\\DBname.mdf'<\/pre>\n<pre>,MOVE 'DBname_log' TO 'S:\\MSSQL\\DBname_Log.ldf'<\/pre>\n<pre>,STATS = 5<\/pre>\n<pre>,REPLACE;<\/pre>\n<pre>GO<\/pre>\n<p>The above code for your database restore should be saved in a file called &#8220;5_RestorePubDatabaseToSub.sql&#8221;.<\/p>\n<h2><strong>Step 6: Disable any triggers on the Subscriber<\/strong><\/h2>\n<p>This step is only needed when Triggers are present.\u00a0 We don&#8217;t want them to fire on the subscriber, so we disable all triggers in the database.\u00a0 I have listed the triggers for my table, but you could create T-SQL code to find and disable all triggers in the database.<\/p>\n<pre>USE DBname&lt;<\/pre>\n<pre>GO\r\n\r\n\r\n\r\n<\/pre>\n<pre>DISABLE TRIGGER trg_ReportWorkflowSave ON ReportPreference;<\/pre>\n<pre>DISABLE TRIGGER trg_ReportWorkflowReportTbl ON Report;<\/pre>\n<p>The above code for your database triggers should be saved in a file called &#8220;6_DisableAllDbTriggersOnSub.sql&#8221;.<\/p>\n<h2><strong>Step 7: Add the Subscription<\/strong><\/h2>\n<p>The following code will add the subscription.\u00a0 Note that we are using push replication.<\/p>\n<pre>USE DBname<\/pre>\n<pre>GO\r\n\r\n\r\n\r\n<\/pre>\n<pre>EXEC sp_addsubscription @publication = N'DBname_Repl'\r\n\r\n,@subscriber = N'SubServer'\r\n\r\n,@destination_db = N'DBname'\r\n\r\n,@subscription_type = N'Push'\r\n\r\n,@sync_type = N'initialize with backup'\r\n\r\n,@backupDeviceType = N'Disk'\r\n\r\n,@backupDeviceName = N'T:\\DBname.bak'\r\n\r\n,@update_mode = N'read only'\r\n\r\n,@subscriber_type = 0\r\n\r\nGO\r\n\r\n\r\n\r\n<\/pre>\n<pre>EXEC sp_addpushsubscription_agent @publication = N'DBname_Repl'\r\n\r\n,@subscriber = N'SubServer'\r\n\r\n,@subscriber_db = N'DBname'\r\n\r\n,@job_login = NULL\r\n\r\n,@job_password = NULL\r\n\r\n,@subscriber_security_mode = 1\r\n\r\n,@frequency_type = 64\r\n\r\n,@frequency_interval = 1\r\n\r\n,@frequency_relative_interval = 1\r\n\r\n,@frequency_recurrence_factor = 0\r\n\r\n,@frequency_subday = 4\r\n\r\n,@frequency_subday_interval = 5\r\n\r\n,@active_start_time_of_day = 0\r\n\r\n,@active_end_time_of_day = 235959\r\n\r\n,@active_start_date = 0\r\n\r\n,@active_end_date = 0\r\n\r\n,@dts_package_location = N'Distributor'<\/pre>\n<pre>GO<\/pre>\n<p>The above code for your subscriber should be saved in a file called &#8220;7_AddSubscriptionOnPub.sql&#8221;.<\/p>\n<h2><strong>Step 8: Enable the Distribution clean up job<\/strong><\/h2>\n<pre>USE distribution<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC msdb..sp_update_job @job_name = 'Distribution clean up: distribution', @enabled = 1;<\/pre>\n<pre>GO<\/pre>\n<pre>\r\n<\/pre>\n<pre>EXEC msdb..sp_start_job @job_name = 'Distribution clean up: distribution'<\/pre>\n<pre>GO<\/pre>\n<p>The above code should be saved in a file called &#8220;8_StartDistribCleanupAgent.sql&#8221;.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Thanks for reading this article,<\/strong><\/p>\n<p><strong>Next steps :<\/strong><\/p>\n<ol>\n<li><strong>Add this script to your database toolkit<\/strong><\/li>\n<li><strong>Share this with your colleagues because Sharing\u00a0 is Learning<\/strong><\/li>\n<li><strong>Comment below if you need any assistance<\/strong><\/li>\n<\/ol>\n<p style=\"text-align: right;\"><em><strong>Powered by <a href=\"http:\/\/www.codereview.co\">CodeReview &#8211; Let&#8217;s make it Better!<\/a><\/strong><\/em><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow\" data-shared=\"sharing-twitter-875\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow\" data-shared=\"sharing-linkedin-875\" class=\"share-linkedin sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on LinkedIn (Opens in new window)<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow\" data-shared=\"sharing-facebook-875\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=facebook\" target=\"_blank\" title=\"Share on Facebook\"><span><\/span><span class=\"sharing-screen-reader-text\">Share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-google-plus-1\"><a rel=\"nofollow\" data-shared=\"sharing-google-875\" class=\"share-google-plus-1 sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=google-plus-1\" target=\"_blank\" title=\"Click to share on Google+\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Google+ (Opens in new window)<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-pocket sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pocket (Opens in new window)<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-email sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to email this to a friend (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-post-wrapper-76243027-875-69e2309088424' data-src='\/\/widgets.wp.com\/likes\/#blog_id=76243027&amp;post_id=875&amp;origin=dotnetsql.info&amp;obj_id=76243027-875-69e2309088424' data-name='like-post-frame-76243027-875-69e2309088424'><h3 class='sd-title'>Like this:<\/h3><div class='likes-widget-placeholder post-likes-widget-placeholder' style='height:55px'><span class='button'><span>Like<\/span><\/span> <span class=\"loading\">Loading...<\/span><\/div><span class='sd-text-color'><\/span><a class='sd-link-color'><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>Scenario There are situations where you might have a large SQL Server database that you need to replicate. Since the database is very large we want to initialize the Subscriber from the SQL Server backup and not use a snapshot.\u00a0 How do we bundle all the steps together to achieve this without performing them manually? &hellip; <a href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Automating Tranzactional Initialization from a backup in SQL Server<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow\" data-shared=\"sharing-twitter-875\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow\" data-shared=\"sharing-linkedin-875\" class=\"share-linkedin sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on LinkedIn (Opens in new window)<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow\" data-shared=\"sharing-facebook-875\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=facebook\" target=\"_blank\" title=\"Share on Facebook\"><span><\/span><span class=\"sharing-screen-reader-text\">Share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-google-plus-1\"><a rel=\"nofollow\" data-shared=\"sharing-google-875\" class=\"share-google-plus-1 sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=google-plus-1\" target=\"_blank\" title=\"Click to share on Google+\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Google+ (Opens in new window)<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-pocket sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pocket (Opens in new window)<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-email sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/automating-tranzactional-initialization-from-a-backup-in-sql-server\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to email this to a friend (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-post-wrapper-76243027-875-69e23090889d0' data-src='\/\/widgets.wp.com\/likes\/#blog_id=76243027&amp;post_id=875&amp;origin=dotnetsql.info&amp;obj_id=76243027-875-69e23090889d0' data-name='like-post-frame-76243027-875-69e23090889d0'><h3 class='sd-title'>Like this:<\/h3><div class='likes-widget-placeholder post-likes-widget-placeholder' style='height:55px'><span class='button'><span>Like<\/span><\/span> <span class=\"loading\">Loading...<\/span><\/div><span class='sd-text-color'><\/span><a class='sd-link-color'><\/a><\/div>","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[25],"tags":[264,87,266,97,40,265],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts\/875"}],"collection":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/comments?post=875"}],"version-history":[{"count":4,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts\/875\/revisions"}],"predecessor-version":[{"id":920,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts\/875\/revisions\/920"}],"wp:attachment":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/media?parent=875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/categories?post=875"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/tags?post=875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}