Table of Contents

Restoring HgLab

Technically, what is required to successfully restore HgLab is to perform a fresh installation and then replace the Database and Home Directory with backed up ones.

It's recommended to restore to the same HgLab version that was used when backups were made. In other words, if you were using HgLab 1.5 when your server died, first restore to HgLab 1.5 and only then do upgrade to whatever the most recent version is. Head over to Download Archive to download the version you need.

Installing HgLab

Get started with installing HgLab. After completing the installation, shut down the Application Pool by running the following command in an Elevated Command Prompt:

%windir%\system32\inetsrv\appcmd stop apppool /"HgLab Application Pool"

This is to ensure that nobody accesses HgLab while it's being restored.

Restoring Database

Again, refer to Back Up and Restore of SQL Server Databases for details.

Here's a script to get you started:

use [master]

restore database [hglab]
  from disk = 'z:\backups\hglab\hglab-full.bak'


use [hglab]

drop user [hglab]
create user [hglab] for login [hglab]

exec sp_addrolemember N'db_datareader', N'hglab'
exec sp_addrolemember N'db_datawriter', N'hglab'
exec sp_addrolemember N'db_ddladmin', N'hglab'
exec sp_addrolemember N'db_owner', N'hglab'

The drop user-create user dance is required to correctly grant access to the restored database.

Restoring Home Directory

What you'll need to do is basically overwrite contents of Home Directory with backed up data:

 xcopy z:\backups\hglab\home "d:\hglab home" /e /i /y

Restoring License

This one is not required since the License is stored inside the Database.

Starting HgLab

It's time to fire up engines. From the Elevated Command Prompt:

%windir%\system32\inetsrv\appcmd start apppool /"HgLab Application Pool"

And now you should be up and running.

comments powered by Disqus

Take HgLab for a Spin

Try HgLab now. Full-featured 45-day evaluation, no credit card required.