How to backup and restore Redtrust
Overview
This guide explains how to back up and restore Redtrust. This process is useful to prevent data loss as well as for testing and migration purposes, and it is intended for IT administrators. This guide assumes you have a basic understanding of Redtrust.
Background
Redtrust allows administrators to create and restore backups of a unit to prevent data loss and support maintenance operations such as migration, recovery, or testing.
Backups can be generated through different interfaces provided by Redtrust:
- The admin console, which allows administrators to create and restore backups through the graphical interface.
- Direct HTTP request, which can be executed from the command line using tools such as Wget or PowerShell.
- The BackupRequester, a command-line utility distributed with Redtrust.
These methods ultimately interact with the same backup functionality exposed by the Redtrust server, allowing administrators to choose the approach that best fits their operational or automation needs.
Step 1: Backup
There are different ways to back up a system, choose the one that better suits your needs.
- Admin console
- Wget
- Powershell
- BackupRequester
To obtain a backup of the unit using the admin console:
- Access Redtrust admin console.
- Go to System > Unit > Backup.
- Click the Backup button. The file should be downloaded right after.
To obtain a backup of the unit using the terminal and Wget execute the following command:
wget --post-data --no-check-certificate 'userLogin=USER@DOMAIN&password=USER_PASSWORD' https://REDTRUST_IP/System/GetDirectBackup -O DESTINATION_FILE.bak
Where:
userLoginis the user with permission to generate backups.passwordis the user's password.REDTRUST_IPshould be replaced with the IP or hostname of the server from which you want to restore Redtrust.DESTINATION_FILEshould be replaced with the name of the downloaded backup file.
The user must have permissions to extract backups.
The --no-check-certificate option is required only if the system executing the command does not trust the server's installed certificate.
To obtain a backup of the unit using the terminal and a Powershell script, create a getRedtrustBackup.ps1 file with the following content:
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
$postParams = @{userlogin='USER@DOMAIN';password='USER_PASSWORD'}
Invoke-WebRequest -Uri https://REDTRUST_IP/System/GetDirectBackup -Method Post -Body $postParams -OutFile DESTINATION_FILE.bak
Where:
userLoginis the user with permission to generate backups.passwordis the user's password.REDTRUST_IPshould be replaced with the IP or hostname of the server from which you want to restore Redtrust.DESTINATION_FILEshould be replaced with the name of the backup file.
You can download a backup with this command:
powershell -executionpolicy bypass -file getRedtrustBackup.ps1
To obtain a backup of the unit using the BackupRequester auxiliary tool open a command line instance and execute a call to the provided application.
BackupRequester.exe rtserver=REDTRUST_IP:PORT username=BACKUP_USER password=USER_PASSWORD output=DESTINATION_FILE overwrite=OVERWRITE_OPTION
Where:
rtserveris the address of the Redtrust server without thehttps://prefix.usernameis the user with permission to generate backups.passwordis the user's password.output(optional) specifies the name of the backup file.overwrite(optional) determines whether an existing file should be overwritten (1overwrites the file; any other value keeps the existing file).
For example:
BackupRequester.exe rtserver=10.27.27.100:8888 username=backup@local password=123 output=C:\Users\Documents\...\last-backup.bak overwrite=0
Step 2: Restore from a backup
In order to restore a backup of the unit:
- Access the Redtrust admin console.
- Go to System > Unit > Backup.
- Click the Recovery file field.
- In the dialog box, select the backup you want to restore and click Open.
- Select Restore and Confirm. Add the password when prompted and then click Send.
The restoration process may take a few minutes. Once it is finished, you will see a green notification and you will be required to restart your session with your credentials.
Verification
- CLI
- BackupRequester
You can verify the process using the command line.
To verify the backup file via the command line, you can use any program that allows you to upload the file to the unit. For example, with cURL, the request should follow this format:
curl --form upload=@BACKUP_FILE.bak --insecure https://REDTRUST_IP/System/CheckBackup
If the backup file sent is correct, the answer is OK.
The service has a limitation to one request per minute.
Backups can be verified using the BackupRequester tool by setting the op parameter to CHECK:
BackupRequester.exe rtserver=REDTRUST_IP username=USERNAME@DOMAIN password=USER_PASSWORD op=CHECK input=BACKUP_FILE.bak
If the backup file sent is correct, the answer is OK.
The service has a limitation to one request per minute.
A list of errors can be found in the System documentation.