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
-
The Postgres executable files and the databases' data files are separate. Which files were removed?CL.– CL.2018年10月16日 08:35:54 +00:00Commented Oct 16, 2018 at 8:35
-
The installations of the different postgresql versions that existed in my distant server which were removedzakaria mouqcit– zakaria mouqcit2018年10月16日 09:41:38 +00:00Commented 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?CL.– CL.2018年10月16日 10:11:15 +00:00Commented 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 unistalledzakaria mouqcit– zakaria mouqcit2018年10月16日 10:15:49 +00:00Commented Oct 16, 2018 at 10:15
-
The actual data is stored somewhere else (see PostgreSQL database default location on Linux).CL.– CL.2018年10月16日 10:18:27 +00:00Commented Oct 16, 2018 at 10:18
1 Answer 1
- Take a backup of the entire data directory for each.
- Reinstall the version of postgresql you need
- 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
-
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 greatzakaria mouqcit– zakaria mouqcit2018年10月15日 16:45:37 +00:00Commented Oct 15, 2018 at 16:45
lang-sql