"Step-by-Step Guide: Changing PostgreSQL Data Storage in BDRSuite Backup Server/Offsite DR"

Steps to Change the PostgreSQL Data Storage Location in BDRSuite Backup Server/BDRSuite Offsite DR Server

KB ID: 115042
Challenge:
You need to migrate the internal PostgreSQL database files of the BDRSuite Backup Server/BDRSuite Offsite DR from one location to another due to increased storage space requirements resulting from the growing backup data size.
Cause:
As the backup data size increases in the BDRSuite Backup Server/BDRSuite Offsite DR server, the storage space of the PostgreSQL database also increases.
Solution:

For BDRSuite Backup Server/BDRSuite Offsite DR Installed on Windows:

Step 1: Find the PostgreSQL Data Storage Location

1. Open the Windows Registry editor.
2. Navigate to the following location, depending on the BDRSuite version:
  1. For BDRSuite v5.3 & above:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BDRSuite_PostgreSQL_DB
  1. For BDRSuite v4.0 to v5.3: 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VembuPostgreSQL
  1. For BDRSuite v3.9 & Below:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PostgreSQL
3. Double click on the 'ImagePath' to open it.
4. The path after "VembuPostgreSQL" -D or "PostgreSQL" -D in the value data represents the PSQL data folder location.
For example: if the path is "C:\ProgramFiles\Vembu\VembuBDR\..\PostgreSQL\10\bin\pg_ctl.exe" runservice -N "VembuPostgreSQL" -D "E:\PostgreSQLData", then "E:\PostgreSQLData" is the current PSQL data storage location.
Edit ImagePath

Step 2: Stop Services

Stop the following services using the Windows services (services.msc):
  1. VembuBDR or VembuOffsiteDR
  2. VembuPostgreSQL
Note: If the Vembu BDR tray application pops up after stopping the services, click on "No" to prevent the tray from automatically starting the Vembu BDR service.

Step 3: Copy PostgreSQLData Folder

Copy the PostgreSQLData folder to the new location where you want to migrate the PostgreSQL data. Ensure that the destination directory/folder has all permissions (read/write) for the local system user.

Step 4: Update Registry Settings

1. Open the Windows Registry editor.
2. Navigate to the following location, depending on the BDRSuite version

  1. BDRSuite 5.3 and above:            HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BDRSuite_PostgreSQL_DB
  2. BDRSuite 4.0 to 5.3:           HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VembuPostgreSQL
  3. BDRSuite 3.9 & Below:         HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PostgreSQL
3. Double click on the 'ImagePath' to open it.
4. Update the new PostgreSQLData folder path in the value data after "VembuPostgreSQL" -D or "PostgreSQL" -D. For example, if the new path is "F:\Newfolder\PostgreSQLData", then update the value data as follows:
   "C:\Program Files\Vembu\VembuBDR\..\PostgreSQL\10\bin\pg_ctl.exe" runservice -N "VembuPostgreSQL" -D "F:\Newfolder\PostgreSQLData".
Edit ImagePath

Step 5: Start Services

Start the following services using the Windows services (services.msc):
  1. VembuPostgreSQL
  2. VembuBDR or VembuOffsiteDR

For BDRSuite Backup Server/BDRSuite Offsite DR Server Installed on Ubuntu:

Step 1: Start an interactive PostgreSQL session and execute the following command to find the current data directory path: “show data_directory;”

Step 2: Stop BDRSuite Server/ BDRSuite Offsite DR and PostgreSQL services using below command:
  1. /etc/init.d/postgresql stop
  2. /etc/init.d/vembubdr stop (or) - /etc/init.d/Vembuoffsitedr stop
Step 3: Copy the  directory (main) from /var/lib/postgres/10/ (Path Found in Step 1) to a new location (/home/newloc/)using the below command
sudo rsync -av /var/lib/postgresql/13/main /home/newloc/main
Step 4: Open ‘postgresql.conf’ file and update ‘data_directory’ value with new path location
Ex: By default, configuration file can be found in following location: /etc/postgresql/9.6/main/postgresql.conf

Step 5: Start PostgreSQL service by executing following command: /etc/init.d/postgresql start
Step 6: Ensure the new data location is updated successfully by repeating Step 1
Step 7: Once the new location is updated successfully, start Vembu BDR (or) Vembu OffsiteDR service to resume backup/replication tasks.
If you encounter any complications during the process to change the PostgreSQL Data Storage location or require additional assistance, please don't hesitate to reach out to our dedicated BDRSuite Support team at vembu-support@vembu.com.

    • Related Articles

    • Steps to Change MongoDB's Data Storage Location

      KB ID: 97 Challenge: Migrating Vembu BDR's internal MongoDB database data files from one location to another. Cause: As the size of backup data increases, the internal meta-information storage space used by MongoDB in the Vembu BDR server may also ...
    • Steps to Rebuild BDRSuite Backup Server running v5.3.0 and above (PostgreSQL Database)

      KB ID: 115900 Challenge A hardware failure or system crash on the BDRSuite Backup Server machine can result in the loss of both the BDRSuite application and its backend database (PostgreSQL server). Solution In case of backup server failure/crash, If ...
    • Deploy Offsite DR Server on Windows

      In this section, we will guide you through the download and step-by-step process of installing the BDRSuite Offsite DR Server on the Windows operating system. Download You can download the BDRSuite offsite DR from the BDRSuite Backup Server. Navigate ...
    • Deploy Offsite DR Server on Linux(Ubuntu)

      In this section, we will guide you through the download and step-by-step process of installing the BDRSuite Offsite DR Server on the Linux operating system. Download You can download the BDRSuite offsite DR from the BDRSuite Backup Server. Navigate ...
    • Applying SSL Certificate to BDRSuite Backup Server & Offsite DR Server

      KB ID: 115039 Problem Description: This knowledge base article provides a step-by-step guide to help users apply an SSL certificate to the BDRSuite Backup Server and Offsite DR Server. Solution: Note: These instructions assume that you have already ...