Skip to content

Commit

Permalink
Plugin to do backup of Microsoft Sql Server (mssql) server
Browse files Browse the repository at this point in the history
Implement a native backup plugin for MSSQL based on the
Virtual Device Interface (VDI) which uses the native MSSQL
backup tooling but instead of writing it to a tape or disk
directly it will save it to a so called virtual device from
which the plugin reads the data on restore we restore to
a virtual device and the native MSSQL software recovers
the database from that.

This is based on the mssql-fd found on sourceforge from 2010
but with a lot of changes to adhere to the Bareos coding style
and to be able to compile it with mingw instead of Visual C.

We also rewrote it to use pthreads instead of the windows threading,
and the whole code is made somewhat more modular using inline
functions which handle certain logic operations.

We also implemented the ability to overwrite the plugin options
which can be passed in via the Plugin Options method from the
restore menu.

Currently we allow on restore to restore to a so called
Point In Time (PIT) using the normal MSSQL STOPBEFORMARK, STOPAT
and STOPATMARK which allow you to rollback to a certain time
or specific LSN (Log Sequence Number). This should all make
sense to MSSQL DBA's who are used to using the native backup
tooling to make disk backups.

Fixes #199: Plugin to do backup of Microsoft Sql Server (mssql) server
  • Loading branch information
Marco van Wieringen committed Sep 27, 2013
1 parent ce0c4ee commit 3559671
Show file tree
Hide file tree
Showing 2 changed files with 1,685 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/win32/plugins/filed/Makefile
Expand Up @@ -14,14 +14,18 @@ ifeq ($(WIN_VERSION),32)
INCLUDES = -I../../.. \
-I../../../include \
-I../../../filed \
-I../../../plugins/filed \
-I../../include \
-I../../compat/include
VDI_INCLUDES = -I../../vdi/include
else
INCLUDES = -I../../.. \
-I../../../include \
-I../../../filed \
-I../../../plugins/filed \
-I../../include \
-I../../compat/include
VDI_INCLUDES = -I../../vdi/include
endif
LDLIBS = ../../lib/libbareos.dll \
$(MINGW_LIB)/libssl.dll.a \
Expand All @@ -30,17 +34,26 @@ LDLIBS = ../../lib/libbareos.dll \
$(MINGW_LIB)/libz.dll.a \
$(WINSOCKLIB) -lole32 -loleaut32 -luuid

all: bpipe-fd.dll
all: bpipe-fd.dll mssqlvdi-fd.dll

bpipe-fd.dll: DLL_USAGE = -DBUILDING_DLL
bpipe-fd.dll: bpipe-fd.o
$(CXX) $(LDFLAGS_DLL) -Wl,--out-implib,$@.a bpipe-fd.o $(LDLIBS) -o $@

mssqlvdi-fd.o: CXXFLAGS += -fpermissive
mssqlvdi-fd.o: mssqlvdi-fd.c
@echo "Compiling $<"
$(CXX) $(DLL_USAGE) $(CXXFLAGS) $(VDI_INCLUDES) -c -o $@ $<

mssqlvdi-fd.dll: DLL_USAGE = -DBUILDING_DLL
mssqlvdi-fd.dll: mssqlvdi-fd.o
$(CXX) $(LDFLAGS_DLL) -Wl,--out-implib,$@.a mssqlvdi-fd.o $(LDLIBS) -o $@

clean:
rm -f *.o

distclean:: clean
rm -f bpipe-fd.dll
rm -f bpipe-fd.dll mssqlvdi-fd.dll

# inference rules
.c.o:
Expand Down

0 comments on commit 3559671

Please sign in to comment.