[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Postgres - recuperate data from files

Posted on 2012-08-20
Medium Priority
Last Modified: 2012-09-04
Hi experts, is there a way to recuperate data from postgres if I pull my hard drive out and plug as a slave on another machine?  Which files?
Question by:thready

Accepted Solution

Evan Cutler earned 2000 total points
ID: 38313576
Pick up the whole thing...

If you have the whole data folder, you have everything you need (as long as architecture is the same). Just try restoring it on another machine before wiping this one out, in case you didn't copy something.

Just save the data directory to disk. When launching Postgres, set the parameter telling it where the data directory is (see: wiki.postgresql.org). Or remove original data directory of the fresh installation and place the copy in its place.

Expert Comment

ID: 38313618
Make sure you use the same postgres version when you swap out the data dirs, I would recommend to just make a backup file in pgadmin and restore it on the new machine.

Author Closing Comment

ID: 38364879
In the end I couldn't try this out because the MBR was gone on the machine, but it sounds like this would have worked otherwise....

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month20 days, 3 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question