Time goes by – and the database content grows larger in number. Sometimes it demands changing database files localization. Unfortunately, older PostgreSQL versions do not offer the possibility of relocating DATA folder. Thus, files ought to be moved manually and the service should be configured, so it would use a new localisation of data files. .
Solution:
- Right-click the position to display context menu and choose Stop option.
- Enter Windows service [services.msc] find PostgreSQL service (the name may differ dependently on installed version).
3. Move DATA folder to new localization (the installation path is C:\Program Files\PostgreSQL\x.x\data), x.x value describes the version of storage engine
4. Open Windows Register Editor [regedit.exe] and find the key.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pgsql-version-number
5. Double-click ImagePath value to open it and find D parameter. D parameter describes the localization of DATA folder for a given PostgreSQL instance. Change path to the new localization of the folder and save the changes.
6. After implementing the changes within the register open PostgreSQL service. It may be done similarily to stopping it by choosing Launch option from the context menu.