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:
- For BDRSuite v5.3 & above:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BDRSuite_PostgreSQL_DB
- For BDRSuite v4.0 to v5.3:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VembuPostgreSQL
- 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.
Step 2: Stop Services
Stop the following services using the Windows services (services.msc):
- VembuBDR or VembuOffsiteDR
- 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
- BDRSuite 5.3 and above: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BDRSuite_PostgreSQL_DB
- BDRSuite 4.0 to 5.3: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VembuPostgreSQL
- 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".
Step 5: Start Services
Start the following services using the Windows services (services.msc):
- VembuPostgreSQL
- VembuBDR or VembuOffsiteDR
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:
- /etc/init.d/postgresql stop
- /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.