Restore HyWorks Controller
The entire HyWorks deployment can be restored from the database backup. In this section, different scenarios and methods will be mentioned in detail.
Restoring the the the the Same HyWorks Controller Version
Restoring the HyWorks Controller using the backed up database of the same version of HyWorks Controller can be done by following steps:
Placing Backup File On HyWorks Controller
Once the backup is taken successfully, the administrator needs to place the backup file in the Appropriate format (.bak format) in the 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 a backup, the file must be extracted first. On extraction, the 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 the Backup file is available. This can be done using the 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. The backup folder works correctly while restoring the HyWorks controller with the SQL server and should be preferred for restoration over any other location.
-
Configure Permissions on Backup File Directory.
-
Please refer to the Troubleshooting section for permission configuration guidelines.
Restore HyWorks Controller
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 the session host server and other modules will start getting conflicting HyWorks Controller server configurations/ communications.
Prerequisites:
-
An appropriate backup file in the specified file format is available for restoration. Refer to the section BackUp File Format.
-
The backup file is available in the appropriate directory. Preferably, the backup file can be kept in the SQL server backup folder itself if the SQL Server is installed locally on the 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
Steps to configure a new controller by restoring the 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 be launched in fresh installation mode, displaying the Welcome screen.
-
Follow the onscreen instructions and proceed until the Service Database Configuration screen.
-
In Database Selection, select the Database type as Microsoft SQL Server; if the backup file is from SQL Server based Controller. Provide the required information, i.e., Database Address, Port Number, Database Name, and Authentication details. Click Next to proceed.
-
Configure the appropriate log server in the Log Database Configuration Screen and click on Next to proceed.
-
On the Restore Database screen:
-
Select checkbox Do you want to restore database?
-
Click Browse.
-
Browse to the 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 the installation to complete.
-
After the completion of installation, the new HyWorks Controller will be up and running with configurations as per the backup.
-
Verify the configurations from the HyWorks Controller Management Console.
Repair the existing HyWorks Controller and restore 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 already has 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 be launched in Maintenance Mode, displaying options to Repair and Uninstall; select option Repair, and Click Next.
-
The maintenance mode with the Repair option provides different configuration screens as most of the configurations are already done during installation. After selecting the Repair option, Administrator will be presented with the following screens:
-
Select the Components Selection screen.
-
Enter the Service Logon credentials.
-
-
On the Restore Database page:
-
Select checkbox Do you want to restore database?
-
Click Browse.
-
Browse the location where the backup file (.bak for SQL Server database) is kept.
-
Select the backup file and click Next.
-
-
Proceed till the Confirm screen in the 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 the completion of repair operations, the existing HyWorks Controller will be repaired with the database restored from the backup file.
-
Verify the configurations from the HyWorks Controller Management Console.
Configurations not supported or not recommended for restore
The following types of HyWorks Controller configurations cannot be restored using a 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 will fail with an error, and even when some backup files are available, the restore should not be attempted.
-
HyWorks Controllers in Two-node Cluster Configuration
It is not recommended to attempt to restore the primary or secondary HyWorks Controller in cluster configuration, though a backup can be taken successfully.
-
Recommendations for Clustered HyWorks Controllers:
-
Prepare a fresh HyWorks Controller with the same version. Add it to the cluster.
-
It will automatically sync the database from the primary HyWorks controller, avoiding any restore process.
-
-
-
Multi-node Setups:
Restoring the backup of the multi-node setup will have all node entries in the cluster configuration and, thus, a restored but corrupted cluster. To avoid any such failures, restoration in multi-node setups should be avoided.
Instead, the following recommendations can be used:
-
Recommendations for Multi-node Clustered HyWorks Controllers:
-
Session Nodes: Session nodes do not keep any specific local data, and thus, a restore is not needed of any session node. Instead, the older ones can be removed, and new ones can be installed by pointing it to management nodes.
-
Management Nodes:
-
Secondary: - In SQL-managed database high-availability, the secondary management node need not be restored, and instead, a new management node can be installed pointing it to the existing database.
- In the HyWorks-managed database high-availability, the secondary management node should be freshly installed and should be added into the existing cluster; this will bring the new management node as the secondary in the cluster.
- Primary: - In SQL-managed database high availability, make the current secondary as primary and remove the old primary management node from the cluster. This management node need not be restored, and instead, a new management node can be installed pointing it to the existing database.
-
In HyWorks, manage database high availability, make current secondary as primary, and remove the old primary management node from the cluster. The secondary management node should be freshly installed and should be added to the existing cluster; this will bring the new management node as the secondary in the cluster.
-
-
Restore using SQL Server Management Studio
As mentioned in the Troubleshooting and the Important section, restoring the HyWorks controller using the Controller setup wizard will have some configurational issues:
- A fresh controller equivalent to the existing controller will be readied, and all other modules in production may start communicating with both of the HyWorks Controllers and cause issues.
- A fresh controller created using a backed-up database will have an entry of the old controller (from where the backup has been taken), and it has to be cleared after the controller is installed completely.
- Restoration can not be done for setups having SQL servers running on Windows servers other than HyWorks Controller.
This method of restoring HyWorks Controller backup, using SQL Management Studio can help to overcome these challenges.
Benefits:
- Initially, only the database will be restored, which means no new HyWorks Controller will be live, similar to the one that has been backed-up.
- The administrator will be able to clean up the database and remove residual entries from the source controller.
- The method can be used to restore the database for configurations, which are using SQL servers running on other than HyWorks Controller server.
Prerequisites:
- The backup file from the source controller is available in the appropriate directory.
-
Preferably, the backup file can be kept in the 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 the backup file is placed in the SQL server backup location.
- Launch SQL Server Management Studio.
- Connect to the SQL Server on which the backup has to be restored.
- Right-click on the left-hand object explorer, right-click on Databases.
- Select option Restore Database...
-
In the Restore Database window:
- Select option Device.
- Click Browse to select the backup file.
- This will open a window box to add a backup file.
-
_Select backup devices and click Add**.
- It should open the SQL Server backup location by default and should list the backup file copied in step# 1.
- Select the file and click OK.
- The selected file should now be shown on the Select backup devices window. Click OK to proceed.
- Administrator should be navigated back to the Restore Database window, displaying all selected options.
- Click OK to continue restoring.
-
A progress bar will be displayed on top of the Restore Database window. Once completed successfully, a message will be displayed confirming the successful restoration of the database.
Part# 2: Installing Controller with Restored DB
-
Copy HyWorks Controller setup on Windows Server with all prerequisites installed and configured.
-
Proceed with installation until the screen Service Database Configuration comes.
-
In the Service Database Configuration screen, provide the 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.
-
A warning will be displayed, suggesting a database with the same name already exists and should it be used.
-
Click YES to proceed with the installation.
-
-
Configure the log database as per recommendations.
-
When installing the controller with an existing database, do not select the restore database option on the **_Restore the Database screen.
-
All other installation configurations should also be done as per deployment and recommendations.
-
Finish the setup - The Controller will be installed with a restored database.
Restoring Higher Version of Database with Older Setup
Consider a situation where HyWorks hot-fixes are applied in a setup, and these hot-fixes had some database changes as well. Now, taking a database backup will have all the latest changes and can be considered a of higher version.
The only setup available is without hot-fix and can be considered old. Using this installer to set up a controller may fail because of the new changes in databases.
The following steps can be followed in such cases to restore the database:
-
Restore the database on the target server using SQL Server Management Studio using the steps mentioned in this section.
-
Now use Controller's old installer (without hot-fixes) and install but with a different database name than the one restored in step# 1.
-
Install the latest hot-fixes on this setup.
-
Latest HyWorks Controller pointing to DB-2.
-
Backed-up database available on SQL server.
-
-
Download and extract the latest Encrypt-Decrypt tool on the HyWorks Controller Server.
-
Run the Encrypt-Decrypt tool with administrator privileges:
-
Select mode as Controller.
-
Browse through the HyWorks Controller installation directory.
-
Locate and select the Edc.Service.exe from the Service folder.
-
Click on Decrypt Config to open the configuration file in decrypted mode.
-
Make the changes in the file to point it to the restored database.
-
Save the changes and close the file.
-
Click on Encrypt Config to re-encrypt the file.
-
Save the changes and close the file.
-
-
Restart the HyWorks Controller service to apply the changes.
Important
Important
-
License configurations will come from the database but license keys have to be applied.
-
If backup was taken of multi-node setups, and new setup is prepared on other than the original node, then configuration of other nodes have to be changed to point to the restored DB.
-
Other troubleshooting and important points can be referred.
Troubleshooting
Duplicate Controller Entry after restore
A secondary controller entry will be automatically added when HyWorks Controller is installed using a backup database using SQL Server as the database.
Procedure to remove secondary controller entry:
-
Log in to the HyWorks management console.
-
Navigate to Server > HyWorks Controller section.
-
Verify that the duplicate entries are present on the same server.
-
Click Delete displayed against one of the entries to remove the secondary controller entry.
Manually configure permission for SQL Server on default Backup Directory
This one-time configuration can help in achieving a convenient way of backup restore from the default directory and avoiding any possible permission issue on the server.
The intention is to provide full control to the 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 in to 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 the Security window, click Add.
-
In the Add User window
-
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.