Migrating user data on Ubuntu from 10.1.3 or later

When you want to use the data, which was in your earlier version, in a new version of Test Hub, you can migrate those user data..

Before you begin

You must have upgraded Test Hub to a new version.

About this task

The following table lists the variables that you must replace with the actual value in the command.

Variables Description
{main}

The name of the release that you provided during the installation of Test Hub.

{backup-release}

The Helm release name of Test Hub where you store the backup data.

{target-release}

The Helm release name of Test Hub where you want to restore the data.

The devops-system is the name of the namespace that is created during the setting up of the k3s environment.

Procedure

  1. Run the following script from the hcl-onetest-base directory to create a directory that contains metadata related to the Persistent Volume Claims and their Persistent Volumes:
    sudo backup.sh create-pvc-links
  2. Stop the Kubernetes cluster by running the k3s-killall.sh command.
  3. Restore the backed-up user data by running the following commands:
    sudo ./backup.sh restore [options] {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.

  4. Restart the Kubernetes cluster by running the systemctl start k3s command to start Test Hub.
  5. Run the following script from the hcl-onetest-server/files directory to create all the missing databases:
    migrate.sh create-missing-dbs {{main}}
    Note: You can expect the output of the command to contain several errors on objects that already exist. They do not indicate a problem with the execution of the script.
  6. Run the following script from the hcl-devops/files directory to verify and test the installed instance:
    hcl-devops/files/helm-test-diag.sh {main} -n devops-system

Results

You have migrated the user data from the earlier version to the new version.

What to do next

You can perform the following tasks: