Re: [GENERAL] Db backup - Mailing list pgsql-general

From John R Pierce
Subject Re: [GENERAL] Db backup
Date
Msg-id da024bc8-dc74-9c9c-4e2e-937cc1c98a98@hogranch.com
Whole thread Raw
In response to Re: [GENERAL] Db backup  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
On 6/8/2017 12:29 PM, John R Pierce wrote:
On 6/8/2017 12:10 PM, Jimmy Lunceford wrote:
A windows 7 computer went bad but the hdd is still operable. Is there a way to transfer the db data directories to another computer or does it require a dump and restore?


the data directories should work as-is on another Windows computer with the same major version and 'build' of postgresql and same 32 vs 64 bitness.   By 'build' I mean like enterpriseDB installer vs BigSQL vs custom-built.   if custom built, the build options will need to be pretty much the same (visualC vs gcc/mingw vs cygwin, and the same general ./configure options, etc etc).


to restore said file system level backup,  I would...

A) install the compatible postgresql build (if the original was 9.3.5, its fine to use 9.3.17)

B) stop the postgresql database service

C) replace the 'data' directory with a copy of the data directory from the disk of said dead box

D) restart the postgresql database service

E) verify your databases are intact and complete.


if you used custom tablespaces, be sure to restore all those at step C, too, qirh the same paths as the originala.


-- 
john r pierce, recycling bits in santa cruz

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: [GENERAL] Db backup
Next
From: Éric
Date:
Subject: Re: [GENERAL] Performance issue with Pointcloud extension