New
Back
Database Management

Reliable database management for modern, high-performance systems.

Back
Data Modernisation

Reliable database management for modern, high-performance systems.

Back
Data Engineering

Reliable database management for modern, high-performance systems.

Back
Analytics & Intelligence

Reliable database management for modern, high-performance systems.

Back
Data Strategy Consulting

Reliable database management for modern, high-performance systems.

How to achieve SQL server replication using backup?

Kiran Thangam
Published on
April 1, 2021

In this blog, I am going to show how to initialize the SQL Server replication using the backup without taking the snapshot for all the articles, we all know if the database is very huge it is time consuming if we use snapshot option. In this example, I am going to show systematic approach on how to achieve replication using backup.

Step 1: First, Configure the publication and choose the database, which you want to participate in replication.

Step 2: Choose the type of replication, next select the tables that you want to participate in replication, in this example I am doing for transactional replication.

Step 3: This is very important step where you have to decide if you want to use snapshot or not. In our case, since we are using backup instead of snapshot so we leave these two fields blank and click on next, as shown in the below figure.

Step 4: After configuring publication, right click on publication properties and set 'Allow initialization from backup files' to true.

Step 5: Now, we need to take the backup of the database from Publisher.

We can use either SSMS or script to do this job. In my example, I am going to use the script.

/*Take backup of publisher database*/

BACKUP DATABASE AdventureWorks2014 TO DISK = 'D:\Replication\AdventureWorks2014.bak '

Step 6: Next, we need to restore the backed-up database on subscriber

/*At the publisher, run the following command */

USE AdventureWorks2014
GO
RESTORE DATABASE AdventureWorks2014 FROM DISK = 'D:\Replication\ AdventureWorks2014.bak '
WITH MOVE 'AdventureWorks2014_Data' TO 'D:\MSSQL\AdventureWorks2014_Data.mdf',
MOVE 'AdventureWorks2014_Log' TO 'D:\MSSQL\AdventureWorks2014_log.ldf',
REPLACE, STATS

Once you execute the above command, you will get the below message, now the replication was successfully setup.

We can check the replication status using SSMS under replication -> Replication Monitor

No snapshot was generated.

All the transaction has been delivered to the subscriber successfully without generating any snapshots.

Kiran Thangam

Our Latest Blogs

From monitoring to modernization, GeoPITS provides expert database management services that enhance performance, strengthen security, and reduce operational costs.

Ready to Transform Your Data?

Geopits works alongside your team as a strategic partner, starting with stabilizing your current databases, then modernizing your data infrastructure, and ultimately helping you unlock the full potential of AI.

170

Happy Clients so far

2100+

Databases Managed

142+

Successful Migrations

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.