User Guide Home   >   Client Plugins   >   MS SQL Plugin



MS SQL Plugin

Syncrify can efficiently backup and restore a running instance of Microsoft SQL server. This page demonstrate how to configure the SQL server plugin in Syncrify. It also talks about some pre-requisites and other important information to keep in mind.



Prerequisites



Background Info

Backing up SQL server a two steps:



Configuration



Directions

The Direction option in Syncrify makes this plugin for MS SQL Server acts differently. Following table describes this behaviour.

Client to ServerThis is the default backup direction. Syncrify asks SQL Server to create a .BAK file, which is then transferred to the remote machine.
Server to ClientThis is like a restore. Syncrify pulls the .BAK file from the server and if Auto Restore is checked, runs a DATABASE RESTORE command against the database.
Two-way syncWe discourage using two-way sync when using this plugin. Since a .BAK file is created on demand, Syncrify will always end-up pushing the local copy to the server. This can create unwanted results.


Manual Restoration

When the Auto Restore option is turned off, you must manually restore a database. Refer to the documentation of MS SQL Server to see how to restore a database for a detail description. In short, you can run the following script:

-- Switch the user to single user
ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
-- Restore the database
RESTORE DATABASE [YourDB] FROM DISK = N'C:\SQLBackup\YourDB.BAK'
go
-- Change the DB back to multi-user
ALTER DATABASE [YourDB] SET MULTI_USER