Backing up the server data on Ubuntu
When you want to upgrade to a new version of the server software or to move your existing environments to new systems, you must back up the server data.
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.
-
Installed the server software and all of the Rational® Test Automation Server pods are in Running state.
-
Communicated to the users that Rational® Test Automation Server might be unavailable for some time until the process is complete.
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-8.1023.0.tgz https://raw.githubusercontent.com/IBM/cloud-pak/master/repo/case/ibm-rtas-case-8.1023.0.tgz
-
Run the following commands to fetch the scripts that are used to install
Kubernetes:
tar xvf ibm-rtas-case-8.1023.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 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.
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 for backup.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 Rational® Test Automation
Server:
k3s-killall.sh
-
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,
This command creates a backup file named my-backup.tar.gz that contains all of the Persistent Volumes associated with pods available in the test-system namespace.sudo ./backup.sh create --namespace test-system my-backup.tar.gz
-
-
Run the following command to restart the cluster and Rational® Test Automation
Server:
sudo systemctl start k3s
Results
You have backed up the data of Rational® Test Automation Server.