Re: Proper way to restore from a basebackup without the WAL-files?

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: John Scalia <jayknowsunix(at)gmail(dot)com>
Cc: Gustav Karlsson <gustav(dot)karlsson(at)bekk(dot)no>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Proper way to restore from a basebackup without the WAL-files?
Date: 2015-12-15 18:19:37
Message-ID: CACjxUsNkeG-Y0T+uOW0mT1ajYJ0wyUUasDZLDxCxmmX+c_kbcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Dec 15, 2015 at 11:47 AM, John Scalia <jayknowsunix(at)gmail(dot)com> wrote:

> If you absolutely must use the pg_basebackup as your source and I'm assuming
> you have a tarball without any of WAL files, you could expand the tarball
> into you data directory, and use pg_resetxlog to "fool" the master into
> starting up. I only say "fool" as it just builds you a blank WAL file which
> this system can use as its integrity check and properly start.

Please note that this will generally leave you with a corrupted
cluster; you would be well advised to follow the advice in the
documentation:

http://www.postgresql.org/docs/9.4/interactive/app-pgresetxlog.html

| After running this command, it should be possible to start the
| server, but bear in mind that the database might contain
| inconsistent data due to partially-committed transactions. You
| should immediately dump your data, run initdb, and reload. After
| reload, check for inconsistencies and repair as needed.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Keith 2015-12-15 18:58:02 Re: Proper way to restore from a basebackup without the WAL-files?
Previous Message Gustav Karlsson 2015-12-15 18:14:17 Re: Proper way to restore from a basebackup without the WAL-files?