Restore HyWorks Controller
Entire HyWorks deployment can be restored from the database backup. In this section, different scenarios, methods will be mentioned in detail.
Placing The BackUp File On HyWorks Controller
Once backup is taken successfully, it is very important for administrator to place the backup file in
-
Appropriate format (.bak format)
-
Appropriate location on controller for restore
BackUp File Format
HyWorks Controller stores the backup file in zip format in the following default location:
C:\Windows\TEMP\DB\BACKUP\
To restore backup, the file must be extracted first. On extraction, following type of file will be available for restore:
- For SQL Server Database: file should use .bak extension
Appropriate Directory For Restore
The location from where backup files can be restored, depends on the HyWorks controller database configurations:
-
For HyWorks Controller with SQL Server Database: While restoring HyWorks Controller with SQL Server configuration, SQL Server should have write access on the directory in which Backup file is available. This can be done using following two methods:
-
Copy Backup File in SQL Server Backup Directory: The default location where the backup is placed does not have the required permission set and thus either the permission should be appropriately configured for SQL Server or the file can be moved to SQL Server Install location -> Backup folder. Backup folder works correctly while restoring HyWorks controller with SQL server and should be preferred for restore over any other location.
-
Configure Permissions on Backup File Directory
-
Please refer Troubleshooting section for permission configuration guidelines.
Restore HyWorks Controller
Important
Important
- In production environments, restore operation should be done very carefully.
- Restored HyWorks Controller and source server (whose backup has been taken) should not run in same network, as session host server and other modules will start getting conflicting HyWorks Controller server configurations.
Prerequisites:
-
Appropriate backup file in specified file format available for restore. Refer section BackUp File Format
-
Backup file is available in appropriate directory. Refer section Appropriate Directory For Restore for details. Preferably, the backup file can be kept in SQL server backup folder itself, if SQL Server is installed locally on same Windows server.
- Default location of SQL Server backup location:
C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\Backup
Restore Process using Controller Setup wizard
Installing New Controller with Backed-up Database
Follow the below listed steps to configure a new controller by restoring backup database
-
Access the Windows server to be configured as HyWorks Controller; which satisfies the following prerequisites
-
All required prerequisites for HyWorks Controller i.e. DotNet4.5, ASP.Net4.5, SSCE runtime, SQL server and Web Server (IIS roles) are configured
-
The server does not have any existing installed HyWorks Controller as the new HyWorks Controller has to be created using existing database backup
-
-
Invoke HyWorks Installer with administrative rights on the server (where the HyWorks Controller is not installed)
-
The Setup wizard will get launched in fresh installation mode displaying Welcome screen
-
Follow the onscreen instructions and proceed until Service Database Configuration screen
-
In Database Selection
Select Database type as Microsoft SQL Server; if the backup file is from SQL Server based Controller. Provide required information i.e. Database Address, Port Number, Database Name, Authentication details ii. Click Next to proceed
-
Configure appropriate log server in Log Database Configuration Screen and click on Next to proceed
-
On Restore Database
-
Select checkbox Do you want to restore database?
-
Click Browse
-
Browse to location where the backup file (.bak for SQL Server database) is kept
-
Select the backup file and click Next
-
-
Follow onscreen instructions; click Install to start the installation
-
Wait for installation to complete
-
After completion of installation, new HyWorks Controller will be up and running with configurations as per the backup
-
Verify the configurations from HyWorks Controller Management Console
Repair existing HyWorks Controller and restoring the backup
-
Access the Windows server to be configured as HyWorks Controller; which satisfies the following prerequisites
-
All required prerequisites for HyWorks Controller i.e. DotNet4.5, ASP.Net4.5, SSCE runtime, SQL server and Web Server (IIS roles) are configured
-
The server is already having an existing installed HyWorks Controller; which should be repaired to restore configurations
-
-
Invoke HyWorks Installer with administrative rights on the server (where the HyWorks Controller is not installed)
-
The Setup wizard will get launched in Maintenance Mode displaying options to Repair and Uninstall; select option Repair, and Click Next
-
Maintenance mode with Repair option provides different configuration screens as most of the configurations as already done during installation. After selecting the Repair option, Administrator will be presented with following screens:
-
Components Selection Screen to select
-
Service Logon Credentials
-
-
On Restore database page
-
Select checkbox Do you want to restore database?
-
Click Browse
-
Browse to location where the backup file (.bak for SQL Server database) is kept
-
Select the backup file and click Next
-
-
Proceed till Confirm screen in Setup wizard by providing appropriate details in different screens; Click Repair to start the repair operation as per configured option and provided database backup file
-
After completion of repair operations, existing HyWorks Controller will be repaired with database restored from backup file.
-
Verify the configurations from HyWorks Controller Management Console
Configurations not supported or not recommended for restore
Following types of HyWorks Controller configurations cannot be restored using backup file and thus the restore should not be attempted on such production configurations.
-
HyWorks Controller configured to use SQL Server database on Remote machine
The backup itself will get failed with appropriate error and even when some backup file is available, the restore should not be attempted.
-
HyWorks Controllers in Cluster Configuration
It is not recommended to attempt restoring primary or secondary HyWorks Controller in cluster configuration though backup can be taken successfully.
-
Recommendations for Clustered HyWorks Controllers:
-
Prepare a fresh HyWorks Controller with same version
-
Add it to the cluster
-
It will automatically sync the database from primary HyWorks controller avoiding any restore process.
-
-
Restore using SQL Server Management Studio
As mentioned in section above, mentioned in Troubleshooting section and in Important section, restoring HyWorks controller using Controller setup wizard will have some configurational issues:
- A fresh controller equivalent to existing controller will be readied and all other modules in production may start communicating with both of the HyWorks Controllers and cause issues
- Fresh controller created using backed-up database will have entry of the old controller (from where backup has been taken) and it has to be cleared after controller is installed completely.
- Restoration can not be done for setups having SQL server running on other Windows server than HyWorks Controller.
This method of restoring HyWorks Controller backup, using SQL Management Studio can help to overcome these challenges.
Benefits:
- Initially only database will be restored, which means no new HyWorks Controller will be live similar to the one which has been backed-up.
- Administrator will be able to clean-up the database, to remove residual entries from source controller.
- The method can be used to restore database for configurations, which are using SQL server running on other than HyWorks Controller server.
Prerequisites:
- Backup file from source controller is available in appropriate directory.
-
Preferably, the backup file can be kept in SQL server backup folder itself.
- Default location of SQL Server backup location:
C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\Backup
Part# 1: Restoring Database
- Assuming backup file is placed in SQL server backup location.
- Launch SQL Server Management Studio
- Connect to SQL Server on which backup has to be restored
- Right click on left hand object explorer, right click on Databases
- Select option Restore Database...
-
In Restore Database window
- Select option Device
- Click on Browser button to select backup file
-
This will automatically open dialog to add backup file
- In Select backup devices dialog, click Add button
- It should open SQL Server backup location by default and should list the backup file copied in step# 1
- Select the file, and click on OK button
- Selected file should now be shown on Select backup devices dialog, click on OK to proceed
- Administrator should be navigated back to Restore Database window, displaying all selected options.
- Click on OK to continue restoring
-
Progress bar will be displayed on top of Restore Database window and once completed successfully, dialog will be displayed confirming successful restore of the database.
Part# 2: Installing Controller and using Restored DB
- Copy HyWorks Controller setup on Windows Server with all prerequisites installed and configured
- Proceed with installation until screen Service Database Configuration comes
- In Service Database Configuration screen, provide following details:
- SQL Server details which has been used to restore the database
- Provide database name same as the one restored
- Provide credentials (Source and destination SQL server configurations should be identical to avoid failures)
- Click on Next to proceed
-
Dialog will be displayed, suggesting database with same already exist and should it be used
- Click on YES to proceed with installation
-
Configure log database as per recommendations
- When installing controller with existing database, Do not select restore database option on Restore database screen
- All other installation configurations should also be done as per deployment and recommendations.
- Finish the setup - Controller will be installed with restored database.
Troubleshooting
Duplicate Controller Entry after restore
Secondary controller entry will be automatically added when HyWorks Controller is installed using backup database using SQL Server as database.
Procedure to remove secondary controller entry:
-
Login into HyWorks management console
-
Go to Server -> HyWorks Controller section
-
Verify the duplicate entries being present of same server
-
Click Delete displayed against one of the entry to remove the secondary controller entry
Manually configure permission for SQL Server on default Backup Directory
This one-time configuration can help in achieving convenient way of backup restore from the default directory and avoiding any possible permission issue on server.
The intention is providing full control to MSSQLSERVER account on the default backup directory; which is
C:\Windows\TEMP\DB\BACKUP\
Follow the below steps to configure permissions on this backup folder:
-
Log into the server. (The change must be made on the actual server, not through a network share.)
-
Select the backup folder highlighted below and Right-click -> Select option Properties
-
In Properties -> Security -> Click Edit
-
In Security dialog, Click Add
-
In Add User dialog
-
Change the Locations to the local server name.
-
Type in NT SERVICE\MSSQLSERVER in the name box. (Do not click Check Names)
-
Click OK. You will then see a list of the matching service accounts. Select MSSQLSERVER, and click OK to accept the selection.
-
You should see the service account listed in the security settings, and can adjust the permissions accordingly.