Last updated on October 27, 2017
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.
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 /apppool.name:"HgLab Application Pool"
This is to ensure that nobody accesses HgLab while it's being restored.
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' go 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'
create user dance is required to correctly grant access to the restored database.
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
This one is not required since the License is stored inside the Database.
It's time to fire up engines. From the Elevated Command Prompt:
%windir%\system32\inetsrv\appcmd start apppool /apppool.name:"HgLab Application Pool"
And now you should be up and running.