Restoring the server data on Ubuntu

You can restore the data that is backed up in HCL OneTest Server at any point in time after you install latest version of server software.

Before you begin

You must have completed the following tasks:

  • Been assigned the same role that was required to install and uninstall the server software.

  • Been granted with the sudo access.

  • Communicated to the users that HCL OneTest Server might be unavailable for some time until the process is complete.

  • Backed up the data from HCL OneTest Server.

About this task

The following procedure is for the restoration of the server data from the current release. If you are upgrading the server software, then you can restore the server data from the earlier version to the latest version during the installation of the server software. For more information, see the Related information section.

Procedure

  1. Log in to the Ubuntu server and open a terminal.
  2. Add the software registry to Helm by running the following command:
    helm repo add hclsoftware https://hclcr.io/chartrepo/ot
  3. Run the following command to extract the base:
    helm pull --untar hclsoftware/hcl-onetest-base --version 8.1023.0
  4. Change to the hcl-onetest-base directory.
    This directory contains the backup.sh script which is required to complete the restore operation.
  5. Create a directory that contains metadata related to the Persistent Volume Claims and their Persistent Volumes by running the following command if you have not done before:
    sudo ./backup.sh create-pvc-links

    You can use the following optional parameter along with the create-pvc-links command:

    --volumes or -v: Use this parameter to specify the directory path of the Volumes.

    For example, backup.sh create-pvc-links -v hcl-onetest-base/my-pvc-links creates a directory called my-pvc-links that stores the metadata required to restore your user data.

    Remember:
    • If you did not provide the volume parameter, by default, the command creates a sub-directory in the same directory where you have the backup script.

    • You must ensure that the directory you create must be empty or not exist to avoid script failure.

  6. Run the following command to stop the cluster and HCL OneTest Server:
    k3s-killall.sh
  7. Run the following command to restore the backed-up user data:
    sudo ./backup.sh restore [options] <backup-file-name>

    The restore command overwrites the existing Persistent Volumes with data from the <backup-file-name>.

    You can use the following parameters along with the restore command:

    • --namespace or -n: Use this parameter to restore a specific namespace from the backup file. If you do not mention the namespace, then volumes from all the namespaces in the backup file are restored. You can map one namespace to another namespace by using a colon (:). The syntax is:
      --namespace <name of the namespace> [:<target-namespace>]
    • --release or -r: Use this parameter if the Helm release name of the server to which the backup is being restored is different than the Helm release name of the server where the backup was taken. The syntax is:
      --release <backup-release>:<target-release>
    • --volumes or -v: Use this parameter to specify the directory path of the volumes. The syntax is:
      --volumes <path-of-the-directory>
    • -k or --confirm: Use this parameter to skip the confirmation step.

    For example,
    sudo ./backup.sh restore --namespace test-system:new-test-system -r rel-1:rel-2 -k my-backup.tar.gz

    This command restores the volumes that are backed up from the rel-1 release in the test-system namespace to the rel-2 release in the new-test-system namespace and skips the confirmation step.

  8. Run the following command to restart the cluster and HCL OneTest Server:
    sudo systemctl start k3s
    Note:
    • The cluster and HCL OneTest Server might take some time to restart and until that time, you cannot access the HCL OneTest Server URL.

    • You can run the kubectl get pods -A command to verify that the Kubernetes environment is working. After a while, the status of the pods must be Running state.

Results

You have restored the data of HCL OneTest Server.