Postgresql Recovery from the file system.

267 views
Skip to first unread message

Ayaz Ahmed

unread,
Jul 7, 2022, 4:04:54 PM7/7/22
to idem...@googlegroups.com
Dear community
I am using Ubuntu 21.04 and Postgresql 13.
Unfortunately today postgres's service has been stopped running. And I don't have any backup.

I have data only in file system /var/lib/postgresql/13/main can I recover my database? If yes please let me know I will be thankful to you.

When I try to connect postgresql through pgadmin system giving below message.

psql: error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Is there any solution for this disaster?

Martin Schönbeck

unread,
Jul 7, 2022, 5:23:33 PM7/7/22
to iDempiere
Hi,
what error messages does postgresql show when you start the service again? (service postgresql status)

Regards,
Martin

Heng Sin Low

unread,
Jul 7, 2022, 10:32:03 PM7/7/22
to idem...@googlegroups.com
you should ask in postgresql user forum instead, should get more help over there.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/CAMtCXyW2PHcZ2nFCMWLBo3bW7rWoOXFcf-%2BXqLE1E71VtkgFAQ%40mail.gmail.com.

Ricardo Alexsander Santana

unread,
Jul 8, 2022, 8:30:39 AM7/8/22
to idem...@googlegroups.com
If you still have the data folder, you could try to recover using docker:

1. Back up your data folder and copy to your computer
2. Launch a docker container with same postgres version of your broken server, pointing the data folder to your recovered data folder, something like this:

docker run -d \
--name my-postgres \
-e POSTGRES_PASSWORD=mypassword \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v /my/recovered/postgres/data:/var/lib/postgresql/data \
postgres:13-bullseye

3. Perform a pg_dump:

docker exec my-postgres pg_dump -U adempiere -d idempiere > ExpDat.dmp

Att.
--
Ricardo Alexsander Santana
ralex...@gmail.com


--

Ayaz Ahmed

unread,
Jul 13, 2022, 1:41:02 AM7/13/22
to idem...@googlegroups.com
attached status png

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.


--
status.png

Martin Schönbeck

unread,
Jul 13, 2022, 4:40:16 AM7/13/22
to iDempiere
Hi,

Ayaz Ahmed schrieb am Mittwoch, 13. Juli 2022 um 07:41:02 UTC+2:
attached status png

if not already done, try a restart

Regards,
Martin

Ayaz Ahmed

unread,
Jul 13, 2022, 4:49:13 AM7/13/22
to iDempiere
I have tried many times but could not recover.

Dirk Niemeyer

unread,
Jul 13, 2022, 5:46:39 AM7/13/22
to idem...@googlegroups.com
On command line you can switch to user postgres and run psql.
Then see if your idempiere database still exists and has content.

Regards

Dirk Niemeyer

Am 13.07.22 um 10:49 schrieb Ayaz Ahmed:

Flo Boj

unread,
Jul 15, 2022, 7:25:46 AM7/15/22
to iDempiere
Hi !
Also
please run pg-dump every day in future .
I crontabed that with cronie every day at 2 minutes past 5 in the morning :  

2 5 * * *  pg_dump -U <username> <databasename>   > /whereever.sql



Best Regards
Florian



Vladislav Khrenov

unread,
Jul 15, 2022, 8:48:26 AM7/15/22
to idem...@googlegroups.com
The better way to use datetime in the backup file name. It's give you a chance to recover not only last backup, where you can got data errors and user mistakes.

пт, 15 июл. 2022 г. в 14:25, Flo Boj <flob...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Martin Schönbeck

unread,
Jul 15, 2022, 9:51:53 AM7/15/22
to iDempiere
Hi,


siber...@gmail.com schrieb am Freitag, 15. Juli 2022 um 14:48:26 UTC+2:
The better way to use datetime in the backup file name. It's give you a chance to recover not only last backup, where you can got data errors and user mistakes.


which can be done easily by using util/RUN_DBExport.sh and perhaps adding some lines to utils/myDBcopy.sh to send the file to something externally.

Regards,
Martin
Reply all
Reply to author
Forward
0 new messages