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.png0.png4.png1.png7.png7.png5.png
Today672
Yesterday1207
This week6657
This month16676
Total3041775

Visitor Info

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

Who Is Online

8
Online

piątek, 22 listopad 2024 11:43

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