0

I was running different postgresql versions. And accidentally they were removed. they contained several databases and I want to recover them. I'm wondering if there'a a command line in linux that allows me to recover lost data.

Your help would be so precious!

Thank you in advance

asked Oct 15, 2018 at 16:32
5
  • The Postgres executable files and the databases' data files are separate. Which files were removed? Commented Oct 16, 2018 at 8:35
  • The installations of the different postgresql versions that existed in my distant server which were removed Commented Oct 16, 2018 at 9:41
  • What do you mean with "installations", the executables or the data files? Do you know the names of the directories that were removed? Commented Oct 16, 2018 at 10:11
  • I accidentally removed the executables such as postgresql-8.4, postgresql-9.1. And I believe when you remove or unistall an app all the data inside is also gone. I wonder if there is a way to recover everything was unistalled Commented Oct 16, 2018 at 10:15
  • The actual data is stored somewhere else (see PostgreSQL database default location on Linux). Commented Oct 16, 2018 at 10:18

1 Answer 1

0
  1. Take a backup of the entire data directory for each.
  2. Reinstall the version of postgresql you need
  3. Point its data directory at your existing one

If you are running a packaged version of postgresql then there might be nothing to do for 3

answered Oct 15, 2018 at 16:41
1
  • I want to recover the ancient postgresql versions wich contains some databases. To be more clear. I wanted to install a newest version of postgresql then I accidentally removed the other versions that were previously installed. Now I want to recover this versions to have the ancient databases. I don't know if it's possible but if there's a way it would be great Commented Oct 15, 2018 at 16:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.