Getting Started Examples

Using MSSQL Compressed Backup (msbp) can be a bit confusing at first. These examples are here to get you started quickly. For more details on each plugin and how to use them please see the extended documentation.

Basic Backup

To backup to a standard SQL Server backup file that can be used by the native backup command you can run the following command:
msbp.exe backup "db(database = model)" "local(path = c:\model.bak)"

Please note the quote around each module statement, they are needed.

Basic Restore

To restore from a standard SQL Server backup file generated by SQL Server or by msbp, run the following command:
msbp.exe restore "local(path = c:\model.bak)" "db(database = model)"

Note that we reverse the order of the database(db) plugin and the storage(local) plugin.

Compressed Backup

Using the basic command above, you can add any number of plugins between the source and destination. For example, you may want to compress the data with the gzip plugin:
msbp.exe backup "db(database = model)" "gzip()" "local(path = c:\model.bak.gz)"

Compressed Restore

And to restore compressed the file, insert "gzip()" in the middle again. Here the gzip plugin knows it is restoring the database, so it will un-compress the data:
msbp.exe restore "local(path = c:\model.bak.gz)" "gzip()" "db(database = model)"

Multi-threaded Compressed Backup

Using the compression command above, you can add any number of files. Since each file runs on its own thread, you can achieve multi-threaded compression. For example:
msbp.exe backup "db(database = model)" "gzip()" "local(path = c:\model1.bak.gz; path = c:\model2.bak.gz;)"

Note we separate each additional file with a semicolon ; and terminate with a semicolon

Multi-threaded Compressed Restore

Restoring from multiple files follows the same syntax as the backup command from earlier. For example:
msbp.exe backup "local(path = c:\model1.bak.gz; path = c:\model2.bak.gz;)" "gzip()" "db(database = model)"

Again, we reverse the order of the storage and database plugin.

Last edited Oct 31, 2013 at 12:54 AM by SQLServerIO, version 1