pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: A A <fellah.tech@yahoo.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Can a broken Postgresql data directory be reconstructed  without losing data?
Date: Sun, 15 Apr 2018 21:48:34 +0900
Message-ID: <20180415124834.GA21024@paquier.xyz> (raw)
In-Reply-To: <22260152.420560.1523780705996@mail.yahoo.com>
References: <22260152.420560.1523780705996.ref@mail.yahoo.com>
	<22260152.420560.1523780705996@mail.yahoo.com>

On Sun, Apr 15, 2018 at 08:25:05AM +0000, A A wrote:
> I'm trying to restore a database from a broken data directory that
> have lost many of its files accidentally.

Let me guess, a wild set of rm commands?

> I have tried unsuccessfully to install new instance of the same
> Postgresql version and then copy (with overwrite) the broken datadir
> to the new one.here the remaining datadir that I'm working on :

This is the kind of things I have found myself doing some times, as well
as some people on this list, and this enters in the category of horror
stories.

So the answer to the question "Can I work on a broken data folder and
save as much data as possible?" is "yes".  However this enters in the
field of dark magics as this requires advanced skills and knowledge of
PostgreSQL, including its internals, its folder structure, and ways to
bypass some protocols or even perhaps patch the upstream code to bypass
some checks to the data you are looking for...  Additionally, this is
usually a step-by-step and case-by-case problem.

Please note that data deleted is gone.  You may be able to get back some
data from the file system which has been deleted, though this requires a
special set of skills and luck.  Hiring a professional is recommended
for such operations.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (4+ messages)

Message-ID: <20180415124834.GA21024@paquier.xyz>
Permalink:  ../20180415124834.GA21024@paquier.xyz/
Also on:    postgresql.org/message-id/20180415124834.GA21024@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: michael@paquier.xyz, fellah.tech@yahoo.com
  Subject: Re: Can a broken Postgresql data directory be reconstructed  without losing data?
  In-Reply-To: <20180415124834.GA21024@paquier.xyz>
  References: <22260152.420560.1523780705996.ref@mail.yahoo.com> <22260152.420560.1523780705996@mail.yahoo.com> <20180415124834.GA21024@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox