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.
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://DEVICE_IP/System/GetDirectBackup -O DESTINATION_FILE.bak
-
Replace
DEVICE_IP
with the IP or hostname of the server from which you want to restore Redtrust. -
Add the
userLogin
andpassword
values.
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://IP_DEVICE/System/GetDirectBackup -Method Post -Body $postParams -OutFile DESTINATION_FILE.bak -
Replace
DEVICE_IP
with the IP or hostname of the Redtrust server from which you want to restore the backup. -
Add the user
userlogin
andpassword
values. -
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.
Usage: rtserver=RTSERVER(without https://) username=BACKUP_USER password=BACKUP_USER_PASSWORD
[output=OUTPUT_FILE] [overwrite=OPTION_SELECTED](1 = true, another value = false) -
Specify the server address without specifying the protocol, user and password.
-
Optionally:
- Specify the
output
value with the file name you want for the downloaded file. - Set the
overwrite
option to 1 to overwrite the file if it already exists on your device.
- Specify the
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=@fichero.bak --insecure https://DEVICE_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
:
RTBackupCheck.exe rtserver=DEVICE_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.