SQL HyperBac - 5.4
Worked examples: restoring a compressed or encrypted backup
Overview
These examples show you how to restore a database that was backed up using SQL HyperBac's compression or encryption. The examples use the compressed or encrypted "AdventureWorks" sample database from Worked examples: backing up with compression or encryption, but you can substitute any database of your own that has been compressed or encrypted by SQL HyperBac.
SQL HyperBac is very easy to use; you don't need to make substantial changes to your existing restore jobs to restore compressed or encrypted backup files. Provided the backup file extensions are registered with SQL HyperBac, decompression or decryption processing is applied automatically.
By default, SQL HyperBac automatically recognizes backup files on any path with the following extensions, and applies the processing shown:
Extension (applies to all paths) |
Processing applied by SQL HyperBac |
*.hbc |
Compression (standard) |
*.hbe |
Encryption (AES-256) |
*.hbc2 |
Compression (fast) Note that fast compression uses less CPU resource, but also results in larger compressed files than SQL HyperBac's standard or ZIP-compatible compression. If your system is I/O-bound (for example, while writing to disk) "fast" compression may actually take longer than the other compression options. |
*.zip or *.rar |
Compression (ZIP-compatible) ZIP-compatible compression creates backup files that you can decompress using many popular 3rd-party tools (for example, WinZip or WinRAR). Note that any tool you use for decompression must support ZIP64. |
For restore jobs, SQL HyperBac will automatically decompress or decrypt the backup data as appropriate.
You can add, modify, and delete extensions and associated processing options using HyperBac Configuration Manager. For example, you might choose to create a new ".bak" extension to use SQL HyperBac with your existing backup jobs. See Working with file paths, extensions, and processing options for further information.
For these examples, we'll use the backup files that were created in Worked examples: backing up with compression or encryption.
Worked example: restoring a SQL HyperBac compressed backup file
First, consider the T-SQL command that was used to back up the "AdventureWorks" database using SQL HyperBac compression:
BACKUP DATABASE [AdventureWorks] TO DISK = 'D:\Backups\AdventureWorks_backup.hbc'
To restore a backup file that uses SQL HyperBac standard compression:
Simply run a RESTORE DATABASE command as you usually would:
RESTORE DATABASE [AdventureWorks] FROM DISK = 'D:\Backups\AdventureWorks_backup.hbc'
That's all you need to do. SQL HyperBac will automatically decompress the backup data during the restore operation.
Exactly the same applies when restoring backup files that use SQL HyperBac fast compression or ZIP-compatible compression. Just use one of the following RESTORE DATABASE commands, and SQL HyperBac will automatically decompress the backup data during the restore operation:
RESTORE DATABASE [AdventureWorks] FROM DISK = 'D:\Backups\AdventureWorks_backup.hbc2'
RESTORE DATABASE [AdventureWorks] FROM DISK = 'D:\Backups\AdventureWorks_backup.zip'
RESTORE DATABASE [AdventureWorks] FROM DISK = 'D:\Backups\AdventureWorks_backup.rar'
Whether you run T-SQL statements from SQL Server Management Studio (either by explicitly typing the statement, or using the GUI options), using SQLCMD, or with any other tool, SQL HyperBac will automatically intercept the backup data, and decompress it.
Worked example: restoring a SQL HyperBac encrypted backup file
First, consider the T-SQL command that was used to back up the "AdventureWorks" database using SQL HyperBac encryption:
BACKUP DATABASE [AdventureWorks] TO DISK = 'D:\Backups\AdventureWorks_backup.hbe'
To restore a backup file that uses SQL HyperBac AES-256 encryption:
Simply run a RESTORE DATABASE command as you usually would:
RESTORE DATABASE [AdventureWorks] FROM DISK = 'D:\Backups\AdventureWorks_backup.hbe'
That's all you need to do. SQL HyperBac will automatically decrypt the backup data during the restore operation.
Note that the key file that was used to encrypt the backup data must be available to SQL HyperBac on the system you are restoring to. By default, SQL HyperBac looks for key files in "C:\Program Files\Red Gate\HyperBac\keys".
Read Managing key files for encrypted backups for important information about managing and backing up key files.
See also |
Was this article helpful?
SQL HyperBac
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL HyperBac
- Using flexible licensing with SQL Backup Pro and SQL HyperBac
- Using SQL Backup Pro and SQL HyperBac together on the same server
- SQL HyperBac release notes - version 5.xx
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Using SQL HyperBac