INFORMATICS

The Best

Przełącznik języka

Zaproś mnie na KAWE

Jeżeli podoba Ci się strona i chcesz wspomóc projekt!

Postaw mi kawę na buycoffee.to

This Site

Płatnik

CMS

Hardware

Uncategorised

Emulators

Powershell

Storage Array

DNS

Antivirus program

Licznik

3.png3.png9.png1.png1.png8.png5.png
Today375
Yesterday1624
This week12001
This month19743
Total3391185

Visitor Info

  • IP: 10.8.112.117
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online

4
Online

sobota, 13 grudzień 2025 10:45

Migrating PostgreSQL files to new server

Gwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywna
 

Migrating PostgreSQL files to new server

Install the latest minor release of the same PostgreSQL major version - e.g. if you were using 9.4.1 before, install 9.4.26. Make sure it's the same architecture - i.e. if you were using a 32-bit PostgreSQL before you must install 32-bit PostgreSQL now.

  • Stop the service (postgresql) using the services control panel (services.msc).
  • Path in services - "C:\Program Files\PostgreSQL\9\bin\pg_ctl.exe" runservice -N "postgresql-x64-9" -D "D:\PostgreSQL\9\data" -w do not
  • Modify the configuration to the following with the sc command:  sc config postgresql-x64-9.4 binPath= "\"C:\Program Files\PostgreSQL\9.4\bin\pg_ctl.exe\" runservice -N \"postgresql-x64-9.4\" -D \"E:\pg_db\data\" -w"
  • Delete %PROGRAMFILES%\PostgreSQL\9.4\data.
  • Copy the old data directory to that location - copy C:\Program Files\PostgreSQL\9.4\data\ to E:\pg_db\data
  • Get properties on the data directory and in the security tab recursively grant full control to NETWORKSERVICE or pgsql -  - bad permissions will prevent the database from starting
  • Start the service using services.msc
  • immediately set up backups.

Search