:::: MENU ::::
Browsing posts in: LiteSpeed

Extract LiteSpeed backups to native format

Extracting

If you don’t want  or can’t use LiteSpeed to restore a backup you have to extract it to native SQL Server format. Quest has a commandline tool for this purpose, no gui here but it is simple to use and pretty straightforward.

Usually placed in C:\Program Files\Quest Software\LiteSpeed\SQL Server.

The program’s name is extractor.exe. If you can’t find it easily then search for this name.
The syntax is :
extractor.exe -F [path to LiteSpeed backupfile] -E [native extracted backupfile]

Example: You have a LiteSpeed compressed backup C:\temp\testDB.bak that you want to extract to C:\temp\testDB_native.bak

extractor.exe -F  C:\temp\testDB.bak -E C:\temp\testDB_native.bak
Here comes the part where almost everyone wonders what went wrong, instead of one backupfile we get multiple, that is because LiteSpeed used multiple threads when executing the backup, resulting in multiple files, compressed together. When extracting these to native we get a striped backup set, with the number of files in the stripe matching the number of threads used by LiteSpeed. So when checking our native extracted backups we can get for example:
C:\temp\testDB_native.bak0
C:\temp\testDB_native.bak1
C:\temp\testDB_native.bak2

Restore

Well how do we restore these then? The same way we always restore a striped backup, we restore them by specifying all files in the backup, not just one as it usually is.
In this case using SSMS we would specify all 3 files, see screenshot below:
restore_multiple

Or in TSQL, the exact same command:

RESTORE DATABASE [testDB]
FROM  DISK = N’C:\temp\testDB_native.bak2′,
DISK = N’C:\temp\testDB_native.bak1′,
DISK = N’C:\temp\testDB_native.bak0′
GO

Extrahera Litespeed backuper till Native format

Extrahering

Vill man inte använda Litespeed för att restora en backup måste man extrahera den till native format, Quest har ett verktyg för det, ren commandline men den funkar bra.
Brukar ligga i C:\Program Files\Quest Software\LiteSpeed\SQL Server.
Programmet heter extractor.exe
Syntaxen är:
extractor.exe -F [sökväg till litespeed backup] -E [native extraherad backupfil]

Exempel: Du har en backup på C:\temp\testDB.bak som du vill extrahera till C:\temp\testDB_native.bak

extractor.exe -F  C:\temp\testDB.bak -E C:\temp\testDB_native.bak
Nu brukar det ibland bli lite funderingar, man får nämligen ofta multipla backupfiler, det är för att extractor skapar en backupfil per tråd Litespeed använde vid den ursprungliga backupen. Så man kan få:
C:\temp\testDB_native.bak0
C:\temp\testDB_native.bak1
C:\temp\testDB_native.bak2

Restore

Hur restorar man dom då? Jo som man alltid gör vid en stripad backup/restore, man specar helt enkelt alla backupfiler vid restoren istället för bara en.
I SSMS skulle man i detta fall ange alla 3 filer, se screenshot nedan:

Eller i T-SQL, exakt samma kommando:

RESTORE DATABASE [testDB]
FROM  DISK = N’C:\temp\testDB_native.bak2′,
DISK = N’C:\temp\testDB_native.bak1′,
DISK = N’C:\temp\testDB_native.bak0′
GO