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

2.png9.png0.png2.png9.png6.png5.png
Today168
Yesterday11
This week5101
This month1938
Total2902965

Visitor Info

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

Who Is Online

4
Online

niedziela, 05 maj 2024 21:30

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