Thread: [GENERAL] Db backup

[GENERAL] Db backup

From
Jimmy Lunceford
Date:
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?
--

Innerspace Strategies

Jimmy Lunceford / HVAC Controls Technicianjimmy_lunceford@innerspacecontrols.com(c) 901-825-7643

485 E. South StreetSTE 104Collierville, TN 38017http://issic.net

Re: [GENERAL] Db backup

From
"Joshua D. Drake"
Date:
On 06/08/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?

As long as the data is intact and you use the same major version of
postgres, yes. Just use robocopy or a standard backup utility.

Thanks,

JD



> --
>
> Innerspace Strategies <http://issic.net/>
>
> Jimmy Lunceford / HVAC Controls
> Technicianjimmy_lunceford@innerspacecontrols.com
> <mailto:jimmy_lunceford@innerspacecontrols.com>(c) 901-825-7643
>
> 485 E. South StreetSTE 104Collierville, TN 38017http://issic.net
> <http://issic.net/>
>


--
Command Prompt, Inc.                  http://the.postgres.company/
                         +1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.
Unless otherwise stated, opinions are my own.


Re: [GENERAL] Db backup

From
John R Pierce
Date:
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).



--
john r pierce, recycling bits in santa cruz



Re: [GENERAL] Db backup

From
John R Pierce
Date:
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