Restoring the server data on Ubuntu
You can restore the data that is backed up in Rational® Test Automation 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 Rational® Test Automation Server might be unavailable for some time until the process is complete.
-
Backed up the data from Rational® Test Automation 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
- Log in to the Ubuntu server and open a terminal.
-
Run the following command to retrieve the case from the IBM Cloud Pack
repository:
curl -o ibm-rtas-case-9.1050.0.tgz https://raw.githubusercontent.com/IBM/cloud-pak/master/repo/case/ibm-rtas-case/9.1050.0/ibm-rtas-case-9.1050.0.tgz
-
Run the following commands to fetch the scripts that are used to install
Kubernetes:
tar xvf ibm-rtas-case-9.1050.0.tgz chmod +x ibm-rtas-case/inventory/ibmRtasBase/files/*.sh
-
Change to the ibm-rtas-case/inventory/ibmRtasBase/files directory.
This directory contains the
backup.sh
script which is required to complete the restore operation. -
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 ibm-rtas-case/inventory/ibmRtasBase/files/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.
-
-
Run the following command to stop the cluster and Rational® Test Automation
Server:
k3s-killall.sh
-
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.
-
-
Run the following command to restart the cluster and Rational® Test Automation
Server:
sudo systemctl start k3s
Note:-
The cluster and Rational® Test Automation Server might take some time to restart and until that time, you cannot access the Rational® Test Automation 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 Rational® Test Automation Server.