When you want to upgrade to a new version of Test Hub or to move your
existing environments to new systems, you must back up the data.
Before you begin
You must have completed the following tasks:
-
Been assigned the same role that was required to install and uninstall
Test Hub.
-
Been granted with the sudo access.
-
Installed Test Hub
and all of the Test Hub pods are in
Running state.
-
Communicated to the users that Test Hub might be
unavailable for some time until the process is complete.
Procedure
-
Log in to the Ubuntu server and open a terminal.
-
Change to the ibm-rtas-case/inventory/ibmRtasBase/files directory.
This directory contains the backup.sh script which is
required to complete the backup operation.
-
Create a directory that contains metadata related to the Persistent Volume
Claims and their Persistent Volumes by running the following command:
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.
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.
-
If you specify a directory by using the -v parameter, then you
must use the same parameter value when you restore the data.
-
Run the following command to stop the cluster and Test Hub:
-
Run the following command to create a backup of the existing user data:
sudo ./backup.sh create [options] <backup-file-name>
After you run this command, a backup of the local Persistent Volumes is
created. The backup is created as tar archives that is compressed by using
gzip (.tar.gz). The create command archives the
Persistent Volumes into the <backup-file-name>.
You can use the following parameters along with the
create command:
-
--namespace or
-n: Use this
parameter to back up the Persistent Volumes in the specified
namespace. If you do not mention the namespace, then all the Volumes
from all the namespaces are included in the backup. The syntax
is:
-namespace <name of the namespace>
-
--volumes or
-v: Use this parameter
to specify the directory path of the Volumes. The syntax
is:
-volumes <path-of-the-directory>
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.
-
If you specify a directory by using the -v parameter,
then you must use the same parameter value when you
restore the data.
For example,
sudo ./backup.sh create --namespace devops-system my-backup.tar.gz
This
command creates a backup file named
my-backup.tar.gz that
contains all of the Persistent Volumes associated with pods available in the
devops-system namespace.
-
Run the following command to restart the cluster and Test Hub:
Results
You have backed up the data of Test Hub.