Re: Recover PostgreSQL database folder data

From: Alan Hodgson <ahodgson(at)lists(dot)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Recover PostgreSQL database folder data
Date: 2017-04-21 21:46:46
Message-ID: 6794801.22GLInlzJf@skynet.simkin.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Fri, Apr 21, 2017 at 12:40 PM, Edson Lidorio <edson(at)openmailbox(dot)org>
>
> wrote:
> > Hi,
> > There was a disaster in my development note. I was able to recover the
> > data folder. PostgreSQL 9.6.2, was installed in Centos 7.
> >
> > Here are the procedures I'm trying to initialize Postgresql for me to do a
> > backup.
> >
> > 1- I installed PostgreSQL 9.6.2 on a VM with Centos 7.
> > 2- I stopped the PostgreSQL service: sudo systemctl stop postgresql-9.6
> > 3- I renamed the /var/lib/pgsql/9.6/data folder to date data_old and
> > copied the old date folder
> >
> > 4- I gave permission in the folder date:
> > sudo chown postgres: postgres /var/lib/pgsql/9.6/data;

Ensure you actually have a folder named "/var/lib/pgsql/9.6/data" with your
database in it (not, possibly, a folder named "date" per your original
message).

as root:

chown -R postgres:postgres /var/lib/pgsql/9.6/data
restorecon -R /var/lib/pgsql/9.6/data

If it still won't start after that, please do an "ls -alRZ
/var/lib/pgsql/9.6", pastebin the output, and send the link.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2017-04-21 22:29:25 Re: pg_basebackup ----xlog-method=stream
Previous Message John R Pierce 2017-04-21 21:42:46 Re: Recover PostgreSQL database folder data