MSSQL

Native Restore From Litespeed Backup

More than once I have had the need to recover the native backup file from within the compressed Litespeed backup file. Fortunately Quest provides an extractor utility in order to help with the process. Otherwise, you would be forced to do a restore followed by a native backup. If your database is of a considerable size then the time needed to accomplish that task could be prohibitive; it will always be simpler to do the extraction as opposed to a restore and a backup.

Extraction is very straightforward. First step is to open a command window and navigate to the directory where the utility is located, this is typically the C:\Program Files\Quest Software\LiteSpeed\SQL Server directory.

Next, issue the following command to extract the native backup files.  Yes, files. In fact you will have one file created for each thread that was used when Litespeed was taking the initial database backup. The command is roughly as follows:

extractor.exe -F [path to backup file taken by litepseed] -E [name of file you want to be created]

So, if you had a backup of AdventureWorks saved to C:\AdWks.bak, and you wanted to extract the native dump from that file and create new files in the same directory, you would run the following command:

extractor.exe -F c:\AdWks.bak -E c:\AdWks_ext.bak

This command results in the creation of multiple files. You can configure a path and filename here if you want to have the files stored somewhere other than the current directory.

OK, so what do you do with these files? Well, you restore them, of course, using either T-SQL or SSMS. One common reason for needing to have a native backup is for those rare times when you need to provide a vendor with a copy and that same vendor does not have a copy of Litespeed. And while the extraction utility makes it easy to provide the necessary files, you have no idea who is on the receiving end of the multiple files. I have lost count of the number of vendors I have sent the extracted files to and received an email back that either says “we don’t know what to do with these files” or “can you send us just one file instead?”

Sure, I can do that as well. Or, I could take a minute to teach you how to do it for yourself. Here goes:

Open up SSMS and all you need to do is point to the files. Just add in each file as shown below, and click OK. Then, select your restore point and click OK again. You should be fine, the database restore should be underway at this point. 

Now, if you prefer T-SQL, the equivalent syntax would be:

RESTORE DATABASE [AdventureWorks]
FROM  DISK = N’C:\AdWks_ext.bak2′,
DISK = N’C:\AdWks_ext.bak1′,
DISK = N’C:\AdWks_ext.bak0′
GO

It’s that simple.

Discussion

5 comments for “Native Restore From Litespeed Backup”

  1. I have found the LiteSpeed GUI so friendly and easy to work with that I use it automatically now, even for native backups. Sure, I *can* do it using the EM/SSMS GUI or t-sql but LiteSpeed’s interface makes it even easier just to use it. No, I’m not an employee of Quest; just appreciate a good product when I see one. Have a Grateful day…Troy

    Posted by Troy Gallant | February 8, 2010, 1:16 pm
  2. this is why my company switched to hyperbac.

    Both backup and restore commands are native so it’s much easier to work with. not to mention it is cheaper and faster.

    Posted by Holland Humphrey | February 8, 2010, 5:45 pm
  3. Great tip.

    I use Litespeed all the time but I was not aware that this could be done.

    Very handy indeed.

    Posted by John Sansom | February 13, 2010, 2:03 pm
  4. [...] Native Restore From Litespeed Backup - Here’s a great tip from Thomas Larock on how to extract the natural SQL Server Backup file from a Litespeed backup archive. [...]

    Posted by Soemthing for the Weekend – SQL Server Links 12/02/10 | John Sansom - SQL Server DBA in the UK | February 13, 2010, 2:22 pm
  5. Holland – do you have any benchmarks you can point us to showing that it’s faster? I’d like to see those.

    Posted by Brent Ozar | February 14, 2010, 4:48 pm

Post a comment