KB ID : 115042
Published : May 11, 2017
Created : May 11, 2017
Last Modified : April 16, 2019

Challenge

Migrating Vembu BDR/ Vembu OffsiteDR internal database(PostgreSQL) files from one location to another location.

Cause

Storage space of the PostgreSQL database increase when there is an increase in backup data size in the Vembu BDR/Vembu OffsiteDR server.

Solution

Follow steps given below to migrate PostgreSQL data:

For Windows

Step 1: Open PostgreSQL in command prompt with the following command: -U postgres -p 32010 and execute the following command to find the current data directory path “show data_directory;”

Open<em>Postgres</em>Data<em>Directory</em>in_Windows

Step 2: Stop VembuBDR/VembuOffsiteDR and PostgreSQL services in services.msc

Step 3: Copy data directory from the old location(Path Found in Step 1) to a new location

Step 4: Ensure the newly created folder has all permissions for the local system user

Step 5: Open Windows Registry editor and go to below path:

For Versions less than 4.0

“HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\Services\PostgreSQL”

Edit ‘ImagePath’ value and change the default path of the data directory to a new location (which comes after -D in value).

Edit ImagePath

From Version 4.0 and later

“HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\Services\VembuPostgreSQL”

Edit ‘ImagePath’ value and change the default path of the data directory to a new location (which comes after -D in value).

Edit ImagePath

Step 6: Start PostgreSQL/VembuPostgreSQL service and ensure new data location is updated by repeating Step 1.

Step 7: Once the new location is updated successfully, start VembuBDR (or) VembuOffsiteDR service to resume backup/replication tasks.

For Ubuntu

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

Open<em>Postgres</em>Data<em>Directory</em>in_Ubuntu

Step 2: Stop Vembu BDR/Vembu OffsiteDR and PostgreSQL services using below command:

  • /etc/init.d/postgresql stop
  • /etc/init.d/vembubdr stop (or) - /etc/init.d/Vembuoffsitedr stop

Step 3: Move data directory from the old location(Path Found in Step 1) to a new location

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

image description

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.

edit retag flag offensive close merge delete