User Guide Home   >   Client Plugins   >   MS SQL Plugin



MS SQL Plugin

Syncrify can efficiently backup and restore a running instance of Microsoft SQL server. Learn how to configure the SQL server plugin in Syncrify.



Prerequisites



Background Info

Backups to SQL server is run in 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