Rebuilding BDRSuite Backup Server from v3.7 to v5.2 (PostgreSQL Server)

Rebuilding BDRSuite Backup Server between version v3.7 to v5.2 (Server Running PostgreSQL)

KB ID: 115063
Challenge:
A hardware failure or system crash on the machine hosting the Vembu BDR backup server can result in the loss of the Vembu BDR application and its PostgreSQL backend installations. However, the backup data can remain intact if it's stored on a separate storage device. In such a scenario, it is possible to completely rebuild the Vembu BDR backup server, provided that the backup data and the database dump file are preserved in the backup storage location.
Solution
To rebuild a Vembu BDR backup server, you need the following components:
1. Backup storage targets containing backup data (e.g., sgstorage folder from all previously attached backup data storage drives). Ensure you have all of them if multiple drives are configured. For example, if E and H drives are configured as storage drives, make sure you have both E:\sgstorage and H:\sgstorage. Rename these 'sgstorage' folders to names like 'old1sgstorage' and 'old2sgstorage'.
2. 'Plugin-data' and 'conf' folders (extracted from 'VembuBDR-Home,' typically located at C:\Program Files\Vembu\VembuBDR for Windows or /home/vembubdr/Vembu/VembuBDR for Linux).
3. Dumped Server Configuration Database file - SGDatabase.sql. By default, the Vembu BDR backup server's configurations are stored in a database that is dumped daily. This file can be found at the path specified during installation for the backup storage location
(e.g., E:\sgstorage\DefaultRepo\SGDatabase.sql for Windows or /sgstorage/DefaultRepo/SGDatabase/SGDatabase.sql for Linux).
Steps to Rebuild Backup Server
Rebuilding the backup server involves a two-step process:
Step 1: Installation of Vembu BDR and PostgreSQL Database
1. Download the same version of the Vembu BDR Backup Server installer that was running on your machine before the failure.
2. Run the installer with administrator/root privileges. Ensure that you configure the same drive letters for the storage location as previously set up (e.g., the same E drive as mentioned in earlier steps).
3. After installation, make sure that the Vembu BDR Backup Server for Virtual Physical Workloads service and Vembu BDR Backup Server for AWS service are not running. If they are running, stop these services.
4. Open the 'Vembu BDR-Home' location and replace the following sub-folders with the sub-folders copied earlier: 'Plugin-data' and 'conf'.
5. Copy the previously renamed sgstorage folders, 'old1sgstorage' and 'old2sgstorage' (renamed during earlier steps), to their respective locations (E, H Drive) and rename them back to "sgstorage".
Step 2: Importing Vembu BDR Backup Server Database
a) Open a command prompt with administrator privileges and run the following command from the PostgreSQL installation location to import the dumped database:
For Windows:
psql.exe -U <user_name> -p <port_num> -d <destination_db> -f <file_path>
Example:
C:\Program Files\PostgreSQL\9.6\bin>psql.exe -U postgres -p 32010 -d SGDatabase -f "E:\sgstorage\Default_Repo\SGDatabase.sql"
For Linux:
psql -U <user_name> -p <port_num> -d <destination_db> -f <file_path>
Example:
psql -U postgres -p 32010 -d SGDatabase -f /sgstorage/Default_Repo/SGDatabase/SGDatabase.sql
Note: To find the port number of PostgreSQL you can execute the command "\conninfo" in the PostgreSQL command line util.
b) If you want to rebuild with all backups present in the backup server, execute the following command in the command prompt from the “VembuBDR-Home” location:
For Windows:
bin\VembuBDR.exe CheckAndUpdateDB All ChunkEntryRefill
For Linux:
./bin/VembuBDR CheckAndUpdateDB All ChunkEntryRefill
OR
If you want to recover the shared schema for a specific backup job name, then execute the following command:
For Windows:
bin\VembuBDR.exe CheckAndUpdateDB All <ClientName> <BackupName> ChunkEntryRefill
For Linux:
./bin/VembuBDR CheckAndUpdateDB All <ClientName> <BackupName> ChunkEntryRefill
After importing the databases, start the Vembu BDR Backup Server for Virtual Physical Workloads service, Vembu BDR Backup Server for AWS service, and PostgreSQL service. Ensure that the backups resume and run successfully.